1 Proposal

1.1 Original grant proposal for Census tract level analyses

1.1.1 Objective 1: Socio-spatial inequalities in urban interventions:

  • To test if urban interventions tend to be located in low SES neighborhoods (H1a); we will run the following model: \[Log(𝔼(UI_{𝑖} \mid X_{𝑖})) = \alpha + \beta_{1} * SES_{𝑖}\] a Poisson regression model with \(UI\) = the number of Urban Interventions between 2016 and 2021, \(SES\) = the socio-economic status of the census track at 2016.
  • To test the reduction in socio-economic inequalities in urban conditions (e.g. length and type of bicycle lanes, NDVI) between 2006 and 2020 (H1b), we will run the following model: \[𝔼(UC_{ij} \mid X_{ij}) = \beta_{0j} + \beta_{1j} ∗ SES + \beta_{2j} ∗ Time + \beta_{3j} ∗ SES ∗ Time + \epsilon_{ij}\] a multilevel linear model with \(UC\) = the Urban condition, \(SES\) = the socio-economic status of the census track.

1.1.2 Objective 2: Examining causal pathways and directionality of intervention/gentrification relation:

  • To test if urban interventions occur before gentrification or if gentrification occurs before the implementation of new urban interventions, we will run two models : (1) \[Logit(𝔼(G_{i} \mid X_{i})) = \alpha + \beta_{1} ∗ UI_{i} + + \beta_{2} ∗ PG_{i} + \beta ∗ X_{control_{i}}\] a logistic regression model among low SES census tracts (2006) with \(G\) = Gentrification between 2006 and 2016, \(UI\) = the number of Urban Interventions between 2001 and 2006, and \(PG\) = SES status 2006; and (2) \[Logit(𝔼(UI_{i} \mid X_{i})) = \alpha + \beta_{1} ∗ G_{i} + \beta_{2} ∗ UC_{i} + \beta ∗ X_{control_{i}}\] a Poisson regression model, with \(UI\) = the number of Urban Interventions between 2016 and 2023, \(G\) = Gentrification between 2006 and 2016, and \(UC\) = Urban Conditions in 2016.

1.2 Paper objective

We focus on obj #1: are urban interventions tend to be located in low SES neighborhoods. Here, the urban interventions considered are bike lanes and canopy/tree coverage and low SES ~ high Pampalon deprivation index. In a second step, we will look at the variations of UI and SES and their association.

Data extraction and pre-analyses for the paper looking at BEI and equity. BEI comprise bike lanes and canopy changes while equity is measured through Pampalon deprivation index. (Partially adapted from original work on BEI bike lanes – see bike_lane_stats.R and ReadMe.md.)

Paper is available here.

General processing steps:

  • Get CT 2016 boundaries (from Cancensus API)
  • Get BEI interventions (canopy / bike lanes) for the selected years (2011 / 2015 / 2016 / 2019)
  • Compute changes between years
    • for the original CT boundaries
    • for buffered CTs (250 / 500 / 750m)

In a second phase, these BEI changes will be linked to Pampalon index for 2016 (and 2011 ?)

UPDATE 2021-12-02 Following discussion with @Yan, add normalized bike line changes:

  • by CT/buffer area
  • by street length within CT/buffer

UPDATE 2021-12-08 Following discussion with @Yan

  • Keep only normalized variation of bike lane length
  • Reverse relation: BEI metric = f(Equity metric (Pampalon / gentrification))
  • Display association at baseline, then add delta over time
  • Canopy : distinguish between high and low canopy

2 Built Environment Intervention Extraction

2.1 Bike lane changes

We use data categorized by Philippe Apparicio’s team who manually identified bike lanes for each census year since 1991. For this study, we limit ourselves to 2016 and 2011 census years.

On top of the original CT boundaries, three levels of buffer have been applied to the CT – 250m, 500m & 750m. Then the same series of processing steps (see above) have been applied to the buffers.

# Bike lanes, from Ph. Apparicio
reseau <- st_read(dsn="data/ReseauCyclableFinal.gdb", layer = "Reseau") # Already in NAD83 / MTM zone 8
## Reading layer `Reseau' from data source 
##   `/Users/benoit/WORKSPACE/gentrification_BEI_equity/data/ReseauCyclableFinal.gdb' 
##   using driver `OpenFileGDB'
## Simple feature collection with 82166 features and 72 fields
## Geometry type: GEOMETRY
## Dimension:     XYZ, XYZM
## Bounding box:  xmin: 266985.5 ymin: 5029251 xmax: 320986.1 ymax: 5062652
## z_range:       zmin: 0 zmax: 43
## m_range:       mmin: 0 mmax: 43
## Projected CRS: NAD83 / MTM zone 8
bike_lane <- reseau %>%
  filter(An2016 == 1 | An2011 == 1) %>%
  select(IdRte, ClsRte, Zone, starts_with("An"), starts_with("Typo_")) %>%
  st_cast("MULTILINESTRING") # Get rid of a few MULTICURVE geometries

# CT boundaries for Montreal
CT16 <- get_census(dataset='CA16', regions=list(CMA='24462'), level='CT', geo_format = "sf") %>%
  filter(Type == "CT") %>%
  mutate(interact_aoi = CD_UID %in% c(2466, 2465, 2458)) %>% # Flag Montréal island, Laval and the South shore (Longueuil, St-Lambert, Brossard)
  st_transform(st_crs(bike_lane))
## Reading geo data from local cache.
CT11 <- get_census(dataset='CA11', regions=list(CMA='24462'), level='CT', geo_format = "sf") %>%
  filter(Type == "CT") %>%
  st_transform(st_crs(bike_lane))
## Reading geo data from local cache.
compute_bikelane_by_area <- function(sf_areas, year_fld, typo_fld) {
  # Compute length of bike lanes within each area.
  # --
  # Parameters:
  #   - sf_areas: sf class object defining the areas of interest, must have a GeoUID field
  #   - year_fld: field name specifying the year of interest, e.g. An2016
  #   - typo_fld: field name specifying the typology for the year of interest, e.g. Typo_2016
  
  year_fld <- enquo(year_fld)
  typo_fld <- enquo(typo_fld)
  
  # Compute intersection of bike lanes with areas
  bk <- bike_lane %>%
    filter(!!year_fld == 1) %>%
    st_intersection(sf_areas) %>%
    mutate(bike_lane_length = st_length(.)) %>%
    as.data.frame() %>%
    group_by(GeoUID, !!typo_fld) %>%
    summarise(bike_lane_length = sum(bike_lane_length)) %>%
    ungroup() %>%
    pivot_wider(names_from = !!typo_fld, names_prefix = "Bike_class", names_sort = TRUE,
                values_from = bike_lane_length, values_fill = units::set_units(0, m)) %>%
    mutate(Bike_lane_total = units::set_units(rowSums(select(., starts_with("Bike_class"))), m))
  
  # Merge back into original sf_areas
  bk <- sf_areas %>%
    left_join(bk)
  
  # Replace NA by 0, which occur in Bike_class length
  bk[is.na(bk)] <- 0
  
  return(bk)
}

compute_streetlength_by_area <- function(sf_areas) {
  # Compute length of streets within each area.
  # --
  # Parameters:
  #   - sf_areas: sf class object defining the areas of interest, must have a GeoUID field

  # Compute intersection of streets with areas
  bk <- reseau  %>%
    st_cast("MULTILINESTRING") %>% # Get rid of a few MULTICURVE geometries
    st_intersection(sf_areas) %>%
    mutate(street_length = st_length(.)) %>%
    as.data.frame() %>%
    group_by(GeoUID) %>%
    summarise(street_length = sum(street_length)) %>%
    ungroup()
  
  # Merge back into original sf_areas
  bk <- sf_areas %>%
    mutate(shape_area_km2 = units::set_units(st_area(.), 'km^2')) %>%
    left_join(bk)
  
  # Replace NA by 0
  bk[is.na(bk)] <- 0
  
  return(bk)
}


# Compute year 2016 and year 2011 bike lanes within 2016 CTs
# NB: contrary to the original work, we keep the same area of reference, i.e. 2016
bike_lane_by_CT16 <- compute_bikelane_by_area(CT16, An2016, Typo_2016)
bike_lane_by_CT11 <- compute_bikelane_by_area(CT16, An2011, Typo_2011)
bike_lane_by_CT06 <- compute_bikelane_by_area(CT16, An2006, Typo_2006)

# Compute buffers, with 3 radii and for each census year
radii <- c(250, 500, 750)

buf_CT16 <- lapply(radii, st_buffer, x=CT16)
names(buf_CT16) <- lapply(radii, function(b) {paste0("buf", b)})

# Compute bike length for each buffer/census year
buf_CT16_w_bike_length <- lapply(buf_CT16, compute_bikelane_by_area, year_fld=An2016, typo_fld=Typo_2016)
names(buf_CT16_w_bike_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT16_w_bike_length$original <- bike_lane_by_CT16

buf_CT11_w_bike_length <- lapply(buf_CT16, compute_bikelane_by_area, year_fld=An2011, typo_fld=Typo_2011)
names(buf_CT11_w_bike_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT11_w_bike_length$original <- bike_lane_by_CT11

buf_CT06_w_bike_length <- lapply(buf_CT16, compute_bikelane_by_area, year_fld=An2006, typo_fld=Typo_2006)
names(buf_CT06_w_bike_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT06_w_bike_length$original <- bike_lane_by_CT06

# Compute total street length within CT/buffer
street_length_by_CT16 <- compute_streetlength_by_area(CT16)
buf_CT16_street_length <- lapply(buf_CT16, compute_streetlength_by_area)
names(buf_CT16_street_length) <- lapply(radii, function(b) {paste0("buf", b)})
buf_CT16_street_length$original <- street_length_by_CT16

# Reorganize data to have all data in one dataframe
bike_lane_changes <- CT16 %>%
  left_join(select(as.data.frame(buf_CT16_street_length$original), GeoUID, street_length, shape_area_km2), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT16_street_length$buf250), GeoUID, street_length, shape_area_km2), by="GeoUID", suffix=c(".ct", ".b250")) %>%
  left_join(select(as.data.frame(buf_CT16_street_length$buf500), GeoUID, street_length, shape_area_km2), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT16_street_length$buf750), GeoUID, street_length, shape_area_km2), by="GeoUID", suffix=c(".b500", ".b750")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$original), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$original), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016ct", ".2011ct")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$buf250), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$buf250), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016b250", ".2011b250")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$buf500), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$buf500), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016b500", ".2011b500")) %>%
  left_join(select(as.data.frame(buf_CT16_w_bike_length$buf750), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT11_w_bike_length$buf750), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2016b750", ".2011b750")) %>%
  left_join(select(as.data.frame(buf_CT06_w_bike_length$original), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT06_w_bike_length$buf250), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2006ct", ".2006b250")) %>%
  left_join(select(as.data.frame(buf_CT06_w_bike_length$buf500), GeoUID, starts_with("Bike_")), by="GeoUID") %>%
  left_join(select(as.data.frame(buf_CT06_w_bike_length$buf750), GeoUID, starts_with("Bike_")), by="GeoUID", suffix=c(".2006b500", ".2006b750"))

# Compute ratio of bike lane vs street length
bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane.by.street.2011ct = 100 * Bike_lane_total.2011ct / street_length.ct,
         Bike_lane.by.street.2011b250 = 100 * Bike_lane_total.2011b250 / street_length.b250,
         Bike_lane.by.street.2011b500 = 100 * Bike_lane_total.2011b500 / street_length.b500,
         Bike_lane.by.street.2011b750 = 100 * Bike_lane_total.2011b750 / street_length.b750,
         Bike_lane.by.street.2016ct = 100 * Bike_lane_total.2016ct / street_length.ct,
         Bike_lane.by.street.2016b250 = 100 * Bike_lane_total.2016b250 / street_length.b250,
         Bike_lane.by.street.2016b500 = 100 * Bike_lane_total.2016b500 / street_length.b500,
         Bike_lane.by.street.2016b750 = 100 * Bike_lane_total.2016b750 / street_length.b750,
         Bike_lane.by.street.2006ct = 100 * Bike_lane_total.2006ct / street_length.ct,
         Bike_lane.by.street.2006b250 = 100 * Bike_lane_total.2006b250 / street_length.b250,
         Bike_lane.by.street.2006b500 = 100 * Bike_lane_total.2006b500 / street_length.b500,
         Bike_lane.by.street.2006b750 = 100 * Bike_lane_total.2006b750 / street_length.b750)

# Compute change between 2011 and 2016 (only for total bike lane length)
bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane_diff.2011.2016ct = Bike_lane_total.2016ct - Bike_lane_total.2011ct,
         Bike_lane_diff.2011.2016b250 = Bike_lane_total.2016b250 - Bike_lane_total.2011b250,
         Bike_lane_diff.2011.2016b500 = Bike_lane_total.2016b500 - Bike_lane_total.2011b500,
         Bike_lane_diff.2011.2016b750 = Bike_lane_total.2016b750 - Bike_lane_total.2011b750)

# Normalize bike lane change by (i) street length and (ii) area
bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane_diff.by.street.2011.2016ct = 100 * Bike_lane_diff.2011.2016ct / street_length.ct,
         Bike_lane_diff.by.street.2011.2016b250 = 100 * Bike_lane_diff.2011.2016b250 / street_length.b250,
         Bike_lane_diff.by.street.2011.2016b500 = 100 * Bike_lane_diff.2011.2016b500 / street_length.b500,
         Bike_lane_diff.by.street.2011.2016b750 = 100 * Bike_lane_diff.2011.2016b750 / street_length.b750,
         Bike_lane_diff.by.area.2011.2016ct = Bike_lane_diff.2011.2016ct / shape_area_km2.ct,
         Bike_lane_diff.by.area.2011.2016b250 = Bike_lane_diff.2011.2016b250 / shape_area_km2.b250,
         Bike_lane_diff.by.area.2011.2016b500 = Bike_lane_diff.2011.2016b500 / shape_area_km2.b500,
         Bike_lane_diff.by.area.2011.2016b750 = Bike_lane_diff.2011.2016b750 / shape_area_km2.b750)

# Save results
st_write(bike_lane_changes, dsn = "data/bike_length_changes.gpkg", delete_layer = TRUE)
## Deleting layer `bike_length_changes' using driver `GPKG'
## Writing layer `bike_length_changes' to data source 
##   `data/bike_length_changes.gpkg' using driver `GPKG'
## Writing 970 features with 140 fields and geometry type Multi Polygon.
# Clean up
rm(buf_CT16)
rm(bike_lane_by_CT11, bike_lane_by_CT16)
rm(buf_CT11_w_bike_length, buf_CT16_w_bike_length)
rm(street_length_by_CT16, buf_CT16_street_length)

2.1.1 Illustration of bike lane metrics

Check output for one specific dataset (Census tracts 2016, no buffer)

2.1.1.1 Raw length

Bike lane length in 2016 within CTs, measured in meters

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_total.2016ct)), lwd=0) +
  scale_fill_continuous(name = "Total length (m)")+ 
  labs(title = "Length of bike lanes within 2016 CTs", subtitle = "(INTERACT study area || for control only)")

2.1.1.2 Absolute length change

Absolute bike lane length change between 2011 and 2016, in meters

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Length (m)")+ 
  labs(title = "Changes in bike lane between 2011 and 2016", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.1.3 Normalized length change (by street)

Relative bike lane length change between 2011 and 2016, normalized by street length within CT in 2016, expressed in %

\[Variation = \frac{Bike Lane_{2016}}{Street Length_{2016}} - \frac{Bike Lane_{2011}}{Street Length_{2016}}\]

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.by.street.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Variation (%)")+ 
  labs(title = "Changes in bike lane between 2011 and 2016, normalized by street", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.1.4 Normalized length change (by area)

Relative bike lane length change between 2011 and 2016, normalized by CT area, expressed in \(\frac{km}{km^{2}}\)

\[Ratio = \frac{Bike Lane_{2016}}{CT Area_{2016}} - \frac{Bike Lane_{2011}}{CT Area_{2016}}\]

ggplot() +
   geom_sf(data=filter(bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.by.area.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Ratio (1/km)")+ 
  labs(title = "Changes in bike lane between 2011 and 2016, normalized by area", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.1.5 Normalized length change (by street) NEW

After some discussion with Yan, we envision using a relative bike lane length ratio change between 2011 and 2016, normalized by the ratio in 2011, expressed in %

\[Variation = \frac{\frac{Bike Lane_{2016}}{Street Length_{2016}} - \frac{Bike Lane_{2011}}{Street Length_{2016}}}{\frac{Bike Lane_{2011}}{Street Length_{2016}}} = \frac{Bike Lane_{2016} - Bike Lane_{2011}}{Bike Lane_{2011}}\]

Problem: all CT with no bike lane in 2011 get a missing data, contrary to the original metric, which measured the absolute variation of the ratio of bike lane to street length.

.bike_lane_changes <- bike_lane_changes %>%
  mutate(Bike_lane_diff.by.street.relative.2011.2016ct = Bike_lane_diff.by.street.2011.2016ct / (Bike_lane_total.2011ct / street_length.ct))

ggplot() +
   geom_sf(data=filter(.bike_lane_changes, interact_aoi), mapping = aes(fill=as.numeric(Bike_lane_diff.by.street.relative.2011.2016ct)), lwd=0) +
  scale_fill_gradient2(name = "Ratio")+ 
  labs(title = "Changes in bike lane ratio between 2011 and 2016, normalized by ratio in 2011", subtitle = "(INTERACT study area || CT level || for control only)")

2.1.2 Basic stats on each layer

2.1.2.1 Census Tracts

# CT level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016ct)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | CT level")

summary(bike_lane_changes$Bike_lane_diff.2011.2016ct)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1377.7     0.0     0.0   262.1   189.7 14463.8
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016ct))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 252 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016ct)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
## -100.000    0.000    0.000    3.665    4.496  100.000      252
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016ct))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016ct)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.1474  0.0000  0.0000  0.4237  0.1764  8.9852
ggplot(.bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.relative.2011.2016ct))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by ratio in 2011")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 461 rows containing non-finite values (stat_bin).

summary(.bike_lane_changes$Bike_lane_diff.by.street.relative.2011.2016ct)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max.      NA's 
## -100.0000    0.0000    0.2199       Inf  102.7796       Inf       367

2.1.2.2 Buffers 250m

# buf250 level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016b250)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | buf 250m")

summary(bike_lane_changes$Bike_lane_diff.2011.2016b250)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3452.5     0.0     0.0   646.7   933.8 20786.8
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016b250))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 233 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016b250)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
## -38.5802   0.0000   0.8538   3.3168   4.9043  56.6588      233
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016b250))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016b250)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.4622  0.0000  0.0000  0.4001  0.4306  6.2156

2.1.2.3 Buffers 500m

# buf500 level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016b500)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | buf 500m")

summary(bike_lane_changes$Bike_lane_diff.2011.2016b250)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3452.5     0.0     0.0   646.7   933.8 20786.8
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016b500))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 229 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016b500)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
## -26.891   0.000   1.385   3.298   5.323  22.121     229
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016b500))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016b500)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -0.94397  0.00000  0.03393  0.38745  0.49370  4.00417

2.1.2.4 Buffers 750m

# buf750 level
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.2011.2016b750)), binwidth = 250) + 
  xlab("Difference of bike lane length between 2016 and 2011 | buf 750m")

summary(bike_lane_changes$Bike_lane_diff.2011.2016b750)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3697.5     0.0   578.6  1842.2  2928.6 29325.1
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.street.2011.2016b750))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by street")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 222 rows containing non-finite values (stat_bin).

summary(bike_lane_changes$Bike_lane_diff.by.street.2011.2016b750)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
## -4.7579  0.1418  1.7793  3.2961  5.2054 22.5448     222
ggplot(bike_lane_changes) +
  geom_histogram(aes(as.numeric(Bike_lane_diff.by.area.2011.2016b750))) + 
  xlab("Difference of bike lane length between 2016 and 2011, normalized by area")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

summary(bike_lane_changes$Bike_lane_diff.by.area.2011.2016b750)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -0.59760  0.00000  0.07793  0.38166  0.53774  3.95463

2.2 Canopy changes

Canopy changes is based on data produced by CMM, using multispectral aerial imagery and lidar. In order to sync the observations with the census years, we focus on 2011 and 2019 with one extra observation point in 2015.

The processing steps are similar to the ones for the bike lanes:

  • Import the raster for each of the 3 years
  • Compute proportion of canopy within each area level (CT and buffers) for the 3 years
# Codes du raster "espace vert"
# 0. No data (hors CMM)
# 1. NDVI < 0,3 et MNH < 3,0m = Minéral bas (route, stationnement, etc.)
# 2. NDVI < 0,3 et MNH ≥ 3,0m = Minéral haut (constructions)
# 3. NDVI ≥ 0,3 et MNH < 3,0m = Végétal bas (culture, gazon, etc.)
# 4. NDVI ≥ 0,3 et MNH ≥ 3,0m = Végétal haut (canopée)
# 5. Aquatique

# Load rasters into pg database for further processing
system('psql -d xgentrif_bei -c "CREATE EXTENSION IF NOT EXISTS postgis"')
system('psql -d xgentrif_bei -c "CREATE EXTENSION IF NOT EXISTS postgis_raster"')

if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2019') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2019/*.tif -F -t 1000x1000 canopee2019 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2019' already imported") }
## PG Raster 'canopee2019' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2017') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2017/*.tif -F -t 1000x1000 canopee2017 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2017' already imported") }
## PG Raster 'canopee2017' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2015') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2015/*.tif -F -t 1000x1000 canopee2015 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2015' already imported") }
## PG Raster 'canopee2015' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2011') IS NOT NULL;")) == 0) {
  system("raster2pgsql -s 32188 -I -C -M data/canopy/2011/*.tif -F -t 1000x1000 canopee2011 | psql -d xgentrif_bei", intern = TRUE)
} else { message("PG Raster 'canopee2011' already imported") }
## PG Raster 'canopee2011' already imported
# Resample to 10m as the original rasters have a 1m resolution, which is too high to allow for a swift processing
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2019_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2019 mode=2\" -r mode -tr 10 10 data/canopy/canopee2019_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2019_10m.tif -F -t 100x100 canopee2019_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2019_10m' already imported") }
## PG Raster 'canopee2019_10m' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2017_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2017 mode=2\" -r mode -tr 10 10 data/canopy/canopee2017_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2017_10m.tif -F -t 100x100 canopee2017_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2017_10m' already imported") }
## PG Raster 'canopee2017_10m' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2015_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2015 mode=2\" -r mode -tr 10 10 data/canopy/canopee2015_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2015_10m.tif -F -t 100x100 canopee2015_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2015_10m' already imported") }
## PG Raster 'canopee2015_10m' already imported
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('canopee2011_10m') IS NOT NULL;")) == 0) {
  system("gdal_translate -of GTiff PG:\"host=localhost dbname=xgentrif_bei table=canopee2011 mode=2\" -r mode -tr 10 10 data/canopy/canopee2011_10m.tif")
  system("raster2pgsql -s 32188 -I -C -M data/canopy/canopee2011_10m.tif -F -t 100x100 canopee2011_10m | psql -d xgentrif_bei")
} else { message("PG Raster 'canopee2011_10m' already imported") }
## PG Raster 'canopee2011_10m' already imported
# Push CT16 to pg
if (nrow(dbGetQuery(con_bei, "SELECT 1 test WHERE to_regclass('ct16') IS NOT NULL;")) == 0) {
  CT16 %>%
    st_transform(crs = 32188) %>%
    st_write(con_bei, "ct16",
             layer_options = c("OVERWRITE=yes", "LAUNDER=true", "SPATIAL_INDEX=gist", "GEOMETRY_NAME=geom"))
  system("psql -d xgentrif_bei -c 'CREATE INDEX ON  ct16 USING gist (geometry)'")
} else { message("PG Layer CT16 already imported") }
## PG Layer CT16 already imported

2.2.1 Extract % of green spaces at various scales

UPDATE 2021-12-08: following discussion with Yan, we decide to focus on extracting canopy years in sync with census years, i.e. 2011 and 2017, and 2015 as an intermediary year. (Previously, we were using the last available year, i.e. 2019), plus keep the option of looking high/low canopy separately

2.2.1.1 Census Tracts

WITH cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.2.1.2 Buffers 250m

WITH ct16 AS (
    select "GeoUID", ST_Buffer(geometry, 250) geometry
    from ct16
),
cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.2.1.3 Buffers 500m

WITH ct16 AS (
    select "GeoUID", ST_Buffer(geometry, 500) geometry
    from ct16
),
cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.2.1.4 Buffers 750m

WITH ct16 AS (
    select "GeoUID", ST_Buffer(geometry, 750) geometry
    from ct16
),
cnt19 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2019_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee19 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2019
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2019
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2019
    FROM cnt19
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt17 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2017_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee17 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2017
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2017
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2017
    FROM cnt17
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt15 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2015_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee15 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2015
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2015
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2015
    FROM cnt15
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
),
cnt11 AS (
    SELECT "GeoUID"
        ,(pvc).value, SUM((pvc).count) As total
    FROM (SELECT "GeoUID"
            ,ST_ValueCount(ST_Clip(rast, geometry)) As pvc
        FROM canopee2011_10m
        JOIN ct16 ON ST_Intersects(geometry, rast)
    ) As foo
    GROUP BY "GeoUID", (pvc).value
),
canopee11 AS (
    SELECT "GeoUID"
        ,round(100. * sum(total) FILTER (WHERE value in (3, 4)) / sum(total), 2) AS pct_esp_vert_2011
        ,round(100. * sum(total) FILTER (WHERE value = 3) / sum(total), 2) AS pct_esp_vert_low_2011
        ,round(100. * sum(total) FILTER (WHERE value = 4) / sum(total), 2) AS pct_esp_vert_high_2011
    FROM cnt11
    WHERE value > 0 -- discard no data, including postgis raster no data
    GROUP BY "GeoUID"
)
SELECT "GeoUID"
    ,st_area(geometry) ct_area_m2
    ,coalesce(pct_esp_vert_low_2011, 0) pct_esp_vert_low_2011
    ,coalesce(pct_esp_vert_high_2011, 0) pct_esp_vert_high_2011
    ,coalesce(pct_esp_vert_2011, 0) pct_esp_vert_2011
    ,coalesce(pct_esp_vert_low_2015, 0) pct_esp_vert_low_2015
    ,coalesce(pct_esp_vert_high_2015, 0) pct_esp_vert_high_2015
    ,coalesce(pct_esp_vert_2015, 0) pct_esp_vert_2015
    ,coalesce(pct_esp_vert_low_2017, 0) pct_esp_vert_low_2017
    ,coalesce(pct_esp_vert_high_2017, 0) pct_esp_vert_high_2017
    ,coalesce(pct_esp_vert_2017, 0) pct_esp_vert_2017
    ,coalesce(pct_esp_vert_low_2019, 0) pct_esp_vert_low_2019
    ,coalesce(pct_esp_vert_high_2019, 0) pct_esp_vert_high_2019
    ,coalesce(pct_esp_vert_2019, 0) pct_esp_vert_2019
FROM ct16
FULL JOIN canopee19 USING ("GeoUID")
FULL JOIN canopee17 USING ("GeoUID")
FULL JOIN canopee15 USING ("GeoUID")
FULL JOIN canopee11 USING ("GeoUID");

2.3 Pampalon index

Get it here

pampalon <- read.xlsx("data/Canada2016Pampalon/A-MSDIData_Can2016_eng/1. EquivalenceTableCanada2016_ENG.xlsx", sheet = 2) %>%
  mutate(DA = as.character(DA)) %>%
  select(DA, SCOREMAT, SCORESOC)

# 2016 DA boundaries for Montreal
DA16 <- get_census(dataset='CA16', regions=list(CMA='24462'), level='DA', geo_format = "sf") %>%
  filter(Type == "DA") %>%
  st_transform(st_crs(bike_lane))
## Reading geo data from local cache.
pampalon <- DA16 %>%
  inner_join(pampalon, by = c("GeoUID" = "DA")) %>%
  as.data.frame()

# Get Pampalon 2006
pampalon06 <- read.xlsx("data/Canada2006Pampalon/A-MSDIData_Can2006_eng/1. CorrespondenceTable_Can2006_eng.xlsx", sheet = 2) %>%
  mutate(DA = as.character(DA)) %>%
  select(DA, DAPOP2006, SCOREMAT, SCORESOC)

# Get LUT DA2006 <-> DA2011 from StatCan
lut_da.1 <- read.csv("data/2011_92-156_DA_AD_txt/2011_92-156_DA_AD.txt", colClasses = "character", 
                     header = FALSE, col.names = c("DAUID2011.ADIDU2011", "DAUID2006.ADIDU2006", "DBUID2011", "DA_rel_flag")) %>%
  select(!c(DBUID2011, DA_rel_flag)) %>%
  unique()

# Link Pampalon 2011 to LUT and compute weighted mean of scores of Pampalon 2011
# NB: population numbers will diverge from  reality when more than one DA is merged into one DA of next census
pampalon06.11 <- pampalon06 %>%
  inner_join(lut_da.1, by = c("DA" = "DAUID2006.ADIDU2006")) %>%
  group_by(DAUID2011.ADIDU2011) %>%
  summarise(pop2006 = sum(DAPOP2006),
            SCOREMAT.06 = weighted.mean(SCOREMAT, DAPOP2006, na.rm = TRUE),
            SCORESOC.06 = weighted.mean(SCORESOC, DAPOP2006, na.rm = TRUE))

# Get Pampalon 2011
pampalon11 <- read.xlsx("data/Canada2011Pampalon/A-MSDIData_Can2011_eng/1. CorrespondenceTable_Can2011_eng.xlsx", sheet = 2) %>%
  mutate(DA = as.character(DA)) %>%
  select(DA, DAPOP2011, SCOREMAT, SCORESOC)

# Get LUT DA2011 <-> DA2016 from StatCan
lut_da <- read.csv("data/2016_92-156_DA_AD_csv/2016_92-156_DA_AD.csv", colClasses = "character") %>%
  select(!c(DBUID2016.IDIDU2016, DA_rel_flag.AD_ind_rel)) %>%
  unique()

# Link Pampalon 2011 to LUT, then to Pampalon 06 and finally compute weighted mean of scores of Pampalon 2011
pampalon11.16 <- pampalon11 %>%
  inner_join(lut_da, by = c("DA" = "DAUID2011.ADIDU2011")) %>%
  left_join(pampalon06.11, by =c("DA" = "DAUID2011.ADIDU2011")) %>%
  group_by(DAUID2016.ADIDU2016) %>%
  summarise(pop2011 = sum(DAPOP2011),
            SCOREMAT = weighted.mean(SCOREMAT, DAPOP2011, na.rm = TRUE),
            SCORESOC = weighted.mean(SCORESOC, DAPOP2011, na.rm = TRUE),
            SCOREMAT.06 = weighted.mean(SCOREMAT.06, pop2006, na.rm = TRUE),
            SCORESOC.06 = weighted.mean(SCORESOC.06, pop2006, na.rm = TRUE),
            pop2006 = sum(pop2006))

# Then link Pampalon 2011 to 2016
pampalon <- pampalon %>%
  left_join(pampalon11.16, by = c("GeoUID" = "DAUID2016.ADIDU2016"), suffix = c(".16", ".11"))

# Aggregate at the CT level
pampalon_CT <- pampalon %>%
  group_by(CT_UID) %>%
  summarise(wSCOREMAT.2016 = weighted.mean(SCOREMAT.16, Population, na.rm = TRUE),
            wSCORESOC.2016 = weighted.mean(SCORESOC.16, Population, na.rm = TRUE),
            wSCOREMAT.2011 = weighted.mean(SCOREMAT.11, pop2011, na.rm = TRUE),
            wSCORESOC.2011 = weighted.mean(SCORESOC.11, pop2011, na.rm = TRUE),
            wSCOREMAT.2006 = weighted.mean(SCOREMAT.06, pop2006, na.rm = TRUE),
            wSCORESOC.2006 = weighted.mean(SCORESOC.06, pop2006, na.rm = TRUE))

# Clean up
rm(lut_da, lut_da.1, pampalon11.16, pampalon06.11, pampalon11, pampalon06)

# Display map
pampalon_CT_geom <- CT16 %>%
  left_join(pampalon_CT, by = c("GeoUID" = "CT_UID")) %>%
  filter(interact_aoi)

pampalon_data <- bi_class(pampalon_CT_geom, x = wSCOREMAT.2016, y = wSCORESOC.2016, style = "quantile", dim = 3)
## Warning in classInt::classIntervals(bins_x, n = dim, style = "quantile"): var
## has missing values, omitted in finding classes
## Warning in classInt::classIntervals(bins_y, n = dim, style = "quantile"): var
## has missing values, omitted in finding classes
map <- ggplot() + 
  geom_sf(data = pampalon_data, mapping = aes(fill = bi_class), color = "white", size = 0.1, show.legend = FALSE) +
  bi_scale_fill(pal = "DkBlue", dim = 3) +
  labs(title = "Pampalon: material and social deprivation index") + 
  theme(panel.background = element_rect(fill = "white"),
        #axis.ticks = element_blank(),
        #axis.text = element_blank(),
        panel.grid = element_line(color = "darkgray", size = 0.2))
legend <- bi_legend(pal = "DkBlue",
                    dim = 3,
                    xlab = "Material ",
                    ylab = "Social ",
                    size = 8)
ggdraw() +
  draw_plot(map, 0, 0, 1, 1) +
  draw_plot(legend, 0.1, .7, 0.2, 0.2)

2.4 Gentrification

# Load gentrified CTs, 5 year span (from repo gentrification_metrics)
ding <- list()
ding[["2016"]] <- st_read("data/gentrified_5years.gpkg", "gentrified_ding_16", quiet=TRUE) %>%
  filter(cma_uid_16 == "24462") %>%
  st_transform(st_crs(bike_lane))
ding[["2011"]] <- st_read("data/gentrified_5years.gpkg", "gentrified_ding_11", quiet=TRUE) %>%
  filter(cma_uid_11 == "24462") %>%
  st_transform(st_crs(bike_lane))
ding[["2006"]] <- st_read("data/gentrified_5years.gpkg", "gentrified_ding_06", quiet=TRUE) %>%
  filter(cma_uid_06 == "24462") %>%
  st_transform(st_crs(bike_lane))

ding_map <- ding[["2016"]] %>%
  left_join(select(as.data.frame(CT16), GeoUID, interact_aoi), by = c("ct_uid_16" = "GeoUID")) %>%
  filter(interact_aoi)

ggplot(data = ding_map) + 
  geom_sf(aes(fill = gentrified_2016_2011, colour=gentrifiable_2011)) +
  scale_fill_manual(values = c("gray", "red", "darkgray"), name = "Gentrified in 2016") +
  scale_colour_manual(values = c("darkgray", "darkred", "darkgray"), name = "Gentrifiable in 2011") +
  labs(title = "Census tract gentrification status in 2016")

2.5 Build complete dataset

All variables + outcome linked at the CT level

.bike_lane_changes <- bike_lane_changes %>%
  as.data.frame() %>%
  select(GeoUID, ends_with("ct", ignore.case = FALSE), ends_with("b250", ignore.case = FALSE), ends_with("b500", ignore.case = FALSE), ends_with("b750", ignore.case = FALSE)) %>%
  select(GeoUID, starts_with("Bike_lane")) # Drop individual category lane length

bei_df <- CT16 %>%
  as.data.frame() %>%
  transmute(CT_UID = GeoUID,
            CD_UID = CD_UID,
            CSD_UID = CSD_UID,
            interact_aoi = interact_aoi,
            Population = Population) %>%
  left_join(pampalon_CT, by="CT_UID") %>%
  left_join(.bike_lane_changes, by=c("CT_UID" = "GeoUID")) %>%
  left_join(as.data.frame(esp_vert_ct), by=c("CT_UID" = "GeoUID")) %>%
  left_join(as.data.frame(esp_vert_buf250), by=c("CT_UID" = "GeoUID"), suffix=c("ct", "b250")) %>%
  left_join(as.data.frame(esp_vert_buf500), by=c("CT_UID" = "GeoUID")) %>%
  left_join(as.data.frame(esp_vert_buf750), by=c("CT_UID" = "GeoUID"), suffix=c("b500", "b750")) %>%
  left_join(select(as.data.frame(ding$`2016`), ct_uid_16, starts_with("gentrif")), by=c("CT_UID" = "ct_uid_16")) %>%
  left_join(select(as.data.frame(ding$`2011`), ct_uid_11, starts_with("gentrif")), by=c("CT_UID" = "ct_uid_11")) %>%
  left_join(select(as.data.frame(ding$`2006`), ct_uid_06, starts_with("gentrif")), by=c("CT_UID" = "ct_uid_06"))
  
  
head(bei_df)
write.csv(bei_df, "data/_results/bei_equity.csv", na="", row.names = FALSE)

Included variables:

  • Census Tracts variables
    • CT_UID: 2016 Census Tract ID
    • CD_UID: 2016 Census Division
    • CSD_UID: 2016 Census Subdivision
    • interact_aoi: Does CT belong to INTERACT study area?
    • Population: 2016 Population within CT
    • ct_area_m2.{ct|b{250|500|750}}: Area of CT or buffer of 250, 500 or 750m radius around CT, in square meters
    • gentrified_2016_2011: Is the CT gentrified in 2016?
    • gentrifiable_2011: Is the CT candidate to gentrification in 2011?
    • gentrified_2011_2006: Is the CT gentrified in 2011
    • gentrifiable_2006: Is the CT candidate to gentrification in 2006
    • gentrified_2006_2001: Is the CT gentrified in 2006
    • gentrifiable_2001: Is the CT candidate to gentrification in 2001
  • Pampalon’s metrics
    • wSCOREMAT.2016: Social deprivation index in 2016 (population weighted)
    • wSCORESOC.2016: Material deprivation index in 2016 (population weighted)
    • wSCOREMAT.2011: Social deprivation index in 2011 (population weighted)
    • wSCORESOC.2011: Material deprivation index in 2011 (population weighted)
  • Bike lane density
    • Bike_lane_total.{2016|2011}{ct|b{250|500|750}}: total length of bike lanes, in 2016 or 2011, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane.by.street.{2016|2011}{ct|b{250|500|750}}: % of bike lanes compared to streets, in 2016 or 2011, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane_diff.2011.2016{ct|b{250|500|750}}: change in total length of bike lanes between 2011 and 2011, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane_diff.by.street.2011.2016{ct|b{250|500|750}}: change in total length of bike lanes between 2011 and 2011, normalized by street length, within CT or buffer of 250, 500 or 750m radius
    • Bike_lane_diff.by.area.2011.2016{ct|b{250|500|750}}: change in total length of bike lanes between 2011 and 2011, normalized by area, within CT or buffer of 250, 500 or 750m radius
  • Green spaces
    • pct_esp_vert_{2011|2015|2019}.{ct|b{250|500|750}}: % of green space in 2011, 2015 or 2019 within CT or buffer of 250, 500 or 750m radius
    • pct_esp_vert_{low|high}_{2011|2015|2019}.{ct|b{250|500|750}}: same as above, except for grass (low) and tree (high)
    • pct_esp_vert_diff{2011|2015}.{2015|2019}.{ct|b{250|500|750}}: change in % of green space between 2011 and 2015, 2011 and 2019 as well as 2011 and 2019, within CT or buffer of 250, 500 or 750m radius

3 Preliminary analyses

3.1 Whole CMA

3.1.1 SES variable distribution

Whole area ~ Montréal CMA / CMM

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("wSCORE")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 122 rows containing non-finite values (stat_bin).

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("gentrif")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_bar() + 
  facet_wrap(~name, scales = "free", ncol = 3)

3.1.2 BEI variable distributions

3.1.2.1 Census Tracts

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*ct$"), matches("^pct_esp_vert_diff.*ct$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 1008 rows containing non-finite values (stat_bin).

3.1.2.2 Buffers 250m

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b250$"), matches("^pct_esp_vert_diff.*b250$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 932 rows containing non-finite values (stat_bin).

3.1.2.3 Buffers 500m

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b500$"), matches("^pct_esp_vert_diff.*b500$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 916 rows containing non-finite values (stat_bin).

3.1.2.4 Buffers 750m

.bei_df_long <- bei_df %>% 
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b750$"), matches("^pct_esp_vert_diff.*b750$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 888 rows containing non-finite values (stat_bin).

3.2 INTERACT study area

INTERACT study area ~ Montréal, Laval, Longueuil, Brossard, St-Lambert

3.2.1 SES variable distribution

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("wSCORE")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 86 rows containing non-finite values (stat_bin).

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, starts_with("gentrif")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_bar() + 
  facet_wrap(~name, scales = "free", ncol = 3)

3.2.2 BEI variable distributions

3.2.2.1 Census Tracts

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*ct$"), matches("^pct_esp_vert_diff.*ct$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

3.2.2.2 Buffers 250m

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b250$"), matches("^pct_esp_vert_diff.*b250$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

3.2.2.3 Buffers 500m

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b500$"), matches("^pct_esp_vert_diff.*b500$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

3.2.2.4 Buffers 750m

.bei_df_long <- bei_df %>% 
  filter(interact_aoi) %>%
  units::drop_units() %>% 
  select(CT_UID, CD_UID, matches("^Bike_lane.*b750$"), matches("^pct_esp_vert_diff.*b750$")) %>%
  pivot_longer(!c(CT_UID, CD_UID))

ggplot(.bei_df_long, aes(value)) +
  geom_histogram() + 
  facet_wrap(~name, scales = "free", ncol = 3)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

4 Association between SES and Urban Conditions at baseline (2011)

Looking at objective #1 | do urban interventions tend to be located in low SES neighborhoods?. We look at \[Urban Condition_{2011} = f(SES_{2011})\] as well as \[Urban Condition_{2011} = f(Gentrification_{2011 \to 2016})\]

Here \(UrbanCondition\) means the state of the urban environment features, such as length of bike lanes, greenness coverage, etc. This needs to be distinguished from \(UrbanIntervention\), which accounts for the changes in the \(UrbanConditions\) (see below).

4.1 Whole CMA

4.1.1 UC vs Pampalon | material

4.1.1.1 Bike lane length

Bike lane ratio to streets (in %)

4.1.1.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.692  -8.223  -2.539   4.865  91.035 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.3615     0.4427  21.146   <2e-16 ***
## wSCOREMAT.2011 -27.2836    10.8382  -2.517    0.012 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.66 on 701 degrees of freedom
##   (267 observations deleted due to missingness)
## Multiple R-squared:  0.008959,   Adjusted R-squared:  0.007545 
## F-statistic: 6.337 on 1 and 701 DF,  p-value: 0.01205
4.1.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.679  -6.135  -1.549   3.578  91.612 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.4442     0.3569  26.464  < 2e-16 ***
## wSCOREMAT.2011 -30.6466     8.8234  -3.473 0.000545 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.531 on 720 degrees of freedom
##   (248 observations deleted due to missingness)
## Multiple R-squared:  0.01648,    Adjusted R-squared:  0.01511 
## F-statistic: 12.06 on 1 and 720 DF,  p-value: 0.0005448
4.1.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.863  -4.306  -1.043   3.152  58.090 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.1999     0.2589  35.529  < 2e-16 ***
## wSCOREMAT.2011 -28.7292     6.4113  -4.481 8.63e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.931 on 723 degrees of freedom
##   (245 observations deleted due to missingness)
## Multiple R-squared:  0.02702,    Adjusted R-squared:  0.02568 
## F-statistic: 20.08 on 1 and 723 DF,  p-value: 8.634e-06
4.1.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.543  -3.805  -0.617   2.484  54.694 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      9.0780     0.2233  40.655  < 2e-16 ***
## wSCOREMAT.2011 -25.5780     5.5471  -4.611 4.73e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.008 on 730 degrees of freedom
##   (238 observations deleted due to missingness)
## Multiple R-squared:  0.0283, Adjusted R-squared:  0.02697 
## F-statistic: 21.26 on 1 and 730 DF,  p-value: 4.731e-06

4.1.1.2 Canopy

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.1.1.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -56.637 -12.862   0.022  11.451  55.361 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      41.6677     0.6414  64.960  < 2e-16 ***
## wSCOREMAT.2011 -134.5745    17.3456  -7.758 2.22e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.66 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.05976,    Adjusted R-squared:  0.05877 
## F-statistic: 60.19 on 1 and 947 DF,  p-value: 2.22e-14
4.1.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -49.361 -10.527  -1.515   9.806  52.577 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      40.1560     0.5888  68.202  < 2e-16 ***
## wSCOREMAT.2011 -111.3184    15.9216  -6.992 5.13e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 18.04 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.04909,    Adjusted R-squared:  0.04808 
## F-statistic: 48.88 on 1 and 947 DF,  p-value: 5.126e-12
4.1.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.103 -10.363  -1.419   9.521  53.004 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      40.1269     0.5747  69.822  < 2e-16 ***
## wSCOREMAT.2011 -102.7972    15.5411  -6.615 6.22e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.61 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.04416,    Adjusted R-squared:  0.04315 
## F-statistic: 43.75 on 1 and 947 DF,  p-value: 6.224e-11
4.1.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -45.887 -11.012  -1.622   9.212  59.121 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     40.2943     0.5706  70.615  < 2e-16 ***
## wSCOREMAT.2011 -95.7911    15.4305  -6.208 8.02e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 17.49 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.0391, Adjusted R-squared:  0.03809 
## F-statistic: 38.54 on 1 and 947 DF,  p-value: 8.023e-10

4.1.1.3 Canopy (trees)

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.1.1.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.667  -6.512  -1.130   4.976  59.824 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.0646     0.3623   52.62   <2e-16 ***
## wSCOREMAT.2011 -99.5613     9.7983  -10.16   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.1 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09831,    Adjusted R-squared:  0.09736 
## F-statistic: 103.2 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.932  -5.623  -1.232   4.227  55.658 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.1746     0.3151  57.687   <2e-16 ***
## wSCOREMAT.2011 -84.8195     8.5197  -9.956   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.654 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09475,    Adjusted R-squared:  0.09379 
## F-statistic: 99.12 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -26.472  -5.196  -1.260   4.060  55.869 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.2182     0.3048  59.769   <2e-16 ***
## wSCOREMAT.2011 -80.1681     8.2427  -9.726   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.34 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09082,    Adjusted R-squared:  0.08986 
## F-statistic: 94.59 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.889  -5.029  -1.078   3.761  81.212 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.3174     0.3075  59.577   <2e-16 ***
## wSCOREMAT.2011 -77.0617     8.3142  -9.269   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.421 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.08317,    Adjusted R-squared:  0.0822 
## F-statistic: 85.91 on 1 and 947 DF,  p-value: < 2.2e-16

4.1.2 UC vs Pampalon | social

4.1.2.1 Bike lane length

Bike lane ratio to streets (in %)

4.1.2.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.711  -8.941  -2.409   4.872  91.128 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.8840     0.5597  15.873   <2e-16 ***
## wSCORESOC.2011  14.8411    14.5655   1.019    0.309    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.71 on 701 degrees of freedom
##   (267 observations deleted due to missingness)
## Multiple R-squared:  0.001479,   Adjusted R-squared:  5.44e-05 
## F-statistic: 1.038 on 1 and 701 DF,  p-value: 0.3086
4.1.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.528  -5.806  -1.459   3.273  90.452 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.7613     0.4485  19.535   <2e-16 ***
## wSCORESOC.2011  23.5742    11.7408   2.008    0.045 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.583 on 720 degrees of freedom
##   (248 observations deleted due to missingness)
## Multiple R-squared:  0.005568,   Adjusted R-squared:  0.004187 
## F-statistic: 4.032 on 1 and 720 DF,  p-value: 0.04503
4.1.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.830 -4.615 -0.960  2.985 56.915 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.4945     0.3255  26.095  < 2e-16 ***
## wSCORESOC.2011  25.1606     8.5360   2.948  0.00331 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.985 on 723 degrees of freedom
##   (245 observations deleted due to missingness)
## Multiple R-squared:  0.01187,    Adjusted R-squared:  0.01051 
## F-statistic: 8.688 on 1 and 723 DF,  p-value: 0.003306
4.1.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane.by.street.2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.558 -4.095 -0.827  2.508 56.198 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.5094     0.2802  30.370  < 2e-16 ***
## wSCORESOC.2011  20.1654     7.3710   2.736  0.00637 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.064 on 730 degrees of freedom
##   (238 observations deleted due to missingness)
## Multiple R-squared:  0.01015,    Adjusted R-squared:  0.008793 
## F-statistic: 7.484 on 1 and 730 DF,  p-value: 0.006375

4.1.2.2 Canopy

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.1.2.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -55.985  -9.922   0.022  10.589  46.670 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      47.9152     0.6448   74.31   <2e-16 ***
## wSCORESOC.2011 -367.4519    18.2439  -20.14   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 16.96 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.2999, Adjusted R-squared:  0.2992 
## F-statistic: 405.7 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -53.688  -8.473  -0.351   8.196  47.075 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      46.0933     0.5805   79.40   <2e-16 ***
## wSCORESOC.2011 -345.7804    16.4258  -21.05   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.27 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.3188, Adjusted R-squared:  0.3181 
## F-statistic: 443.1 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -53.073  -7.791  -0.226   7.806  49.805 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       45.82       0.57   80.38   <2e-16 ***
## wSCORESOC.2011  -330.47      16.13  -20.49   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.99 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.3072, Adjusted R-squared:  0.3065 
## F-statistic: 419.9 on 1 and 947 DF,  p-value: < 2.2e-16
4.1.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -52.905  -8.180  -0.252   7.694  56.265 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      45.8440     0.5688   80.60   <2e-16 ***
## wSCORESOC.2011 -321.4983    16.0933  -19.98   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.96 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.2965, Adjusted R-squared:  0.2957 
## F-statistic: 399.1 on 1 and 947 DF,  p-value: < 2.2e-16

4.1.2.3 Canopy (trees)

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.1.2.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -22.586  -7.331  -1.080   5.658  55.969 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     20.4634     0.4304  47.541  < 2e-16 ***
## wSCORESOC.2011 -96.6304    12.1790  -7.934 5.96e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.32 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.06233,    Adjusted R-squared:  0.06134 
## F-statistic: 62.95 on 1 and 947 DF,  p-value: 5.958e-15
4.1.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.374  -6.478  -0.976   4.994  52.468 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.4574     0.3725  52.235  < 2e-16 ***
## wSCORESOC.2011 -87.2741    10.5397  -8.281 4.15e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.798 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.06752,    Adjusted R-squared:  0.06653 
## F-statistic: 68.57 on 1 and 947 DF,  p-value: 4.149e-16
4.1.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.181  -6.123  -0.941   4.868  52.894 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.4028     0.3606  53.807  < 2e-16 ***
## wSCORESOC.2011 -80.9793    10.2029  -7.937 5.84e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.485 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.06237,    Adjusted R-squared:  0.06138 
## F-statistic: 62.99 on 1 and 947 DF,  p-value: 5.838e-15
4.1.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_high_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.157  -5.940  -1.049   4.276  81.057 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.4523     0.3633  53.546   <2e-16 ***
## wSCORESOC.2011 -77.6318    10.2788  -7.553    1e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.556 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.05681,    Adjusted R-squared:  0.05582 
## F-statistic: 57.04 on 1 and 947 DF,  p-value: 1.003e-13

4.1.3 UC vs gentrified CT

Gentrified CT between 2011 and 2016

4.1.3.1 Bike lane length

Bike lane ratio to streets (in %)

4.1.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011ct, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 244 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011ct, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1    113   112.6   0.829  0.363
## Residuals            701  95266   135.9               
## 267 observations deleted due to missingness
4.1.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011b250, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 225 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b250, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      3    2.89   0.032  0.859
## Residuals            720  66058   91.75               
## 248 observations deleted due to missingness
4.1.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011b500, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 222 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b500, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     21   21.01    0.43  0.512
## Residuals            723  35349   48.89               
## 245 observations deleted due to missingness
4.1.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011b750, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 215 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b750, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     36   35.90   0.974  0.324
## Residuals            730  26911   36.86               
## 238 observations deleted due to missingness

4.1.3.2 Canopy

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.1.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_2011ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  44236   44236     121 <2e-16 ***
## Residuals            945 345538     366                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_2011b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  34642   34642     113 <2e-16 ***
## Residuals            945 289603     306                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_2011b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  31182   31182   106.9 <2e-16 ***
## Residuals            945 275548     292                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_2011b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  29134   29134   101.5 <2e-16 ***
## Residuals            945 271367     287                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

4.1.3.3 Canopy (trees)

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.1.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   2815    2815   21.16 4.81e-06 ***
## Residuals            945 125732     133                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.3.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1780  1780.0   17.75 2.76e-05 ***
## Residuals            945  94772   100.3                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.3.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1506  1506.3   16.12 6.42e-05 ***
## Residuals            945  88299    93.4                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
4.1.3.3.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1368  1367.9   14.47 0.000151 ***
## Residuals            945  89326    94.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

4.2 INTERACT study area

# keep only interact CT
bei_df_aoi <- filter(bei_df, interact_aoi)

4.2.1 UC vs Pampalon | material

4.2.1.1 Bike lane length

Bike lane ratio to streets (in %)

4.2.1.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.200  -7.709  -2.064   5.143  59.255 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.8868     0.3611  24.613  < 2e-16 ***
## wSCOREMAT.2011 -27.1407     8.8021  -3.083  0.00213 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.409 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.01363,    Adjusted R-squared:  0.0122 
## F-statistic: 9.508 on 1 and 688 DF,  p-value: 0.002128
4.2.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -12.4394  -5.3193  -0.8782   3.8947  24.9430 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.9081     0.2544  35.019  < 2e-16 ***
## wSCOREMAT.2011 -33.4497     6.2014  -5.394 9.49e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.629 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04057,    Adjusted R-squared:  0.03918 
## F-statistic: 29.09 on 1 and 688 DF,  p-value: 9.492e-08
4.2.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.7672  -3.9200  -0.7691   3.1333  20.7230 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.9691     0.2162  41.488  < 2e-16 ***
## wSCOREMAT.2011 -31.0529     5.2703  -5.892 5.97e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.634 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04804,    Adjusted R-squared:  0.04665 
## F-statistic: 34.72 on 1 and 688 DF,  p-value: 5.971e-09
4.2.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.5371  -3.5685  -0.5231   2.4075  18.3871 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.9986     0.1938  46.431  < 2e-16 ***
## wSCOREMAT.2011 -26.8673     4.7248  -5.686 1.92e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.05 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04489,    Adjusted R-squared:  0.0435 
## F-statistic: 32.34 on 1 and 688 DF,  p-value: 1.918e-08

4.2.1.2 Canopy

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.2.1.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.859 -11.624  -0.331   8.977  47.657 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      37.9617     0.5933  63.988  < 2e-16 ***
## wSCOREMAT.2011 -109.4130    14.4631  -7.565 1.25e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.46 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07679,    Adjusted R-squared:  0.07545 
## F-statistic: 57.23 on 1 and 688 DF,  p-value: 1.247e-13
4.2.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -41.973  -8.235  -0.954   7.170  41.284 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     36.0871     0.4897  73.690  < 2e-16 ***
## wSCOREMAT.2011 -90.8096    11.9387  -7.606 9.29e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.76 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07757,    Adjusted R-squared:  0.07623 
## F-statistic: 57.86 on 1 and 688 DF,  p-value: 9.289e-14
4.2.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -40.955  -8.076  -0.976   7.123  40.579 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     36.1464     0.4645  77.820  < 2e-16 ***
## wSCOREMAT.2011 -83.2220    11.3236  -7.349 5.66e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.1 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07279,    Adjusted R-squared:  0.07145 
## F-statistic: 54.01 on 1 and 688 DF,  p-value: 5.662e-13
4.2.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -38.621  -8.282  -0.894   7.305  39.867 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      36.211      0.451  80.287  < 2e-16 ***
## wSCOREMAT.2011  -76.126     10.995  -6.923 1.01e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.75 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.06513,    Adjusted R-squared:  0.06377 
## F-statistic: 47.93 on 1 and 688 DF,  p-value: 1.013e-11

4.2.1.3 Canopy (trees)

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.2.1.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -29.954  -5.492  -0.802   4.630  44.704 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.8069     0.3379   55.66   <2e-16 ***
## wSCOREMAT.2011 -96.7463     8.2370  -11.74   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.805 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.167,  Adjusted R-squared:  0.1658 
## F-statistic:   138 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -25.9166  -4.2910  -0.8451   3.4739  27.8788 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     17.6539     0.2668   66.17   <2e-16 ***
## wSCOREMAT.2011 -81.7658     6.5045  -12.57   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.953 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1868, Adjusted R-squared:  0.1856 
## F-statistic:   158 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -25.4603  -4.0485  -0.9957   3.5770  26.5204 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      17.738      0.250   70.96   <2e-16 ***
## wSCOREMAT.2011  -76.880      6.094  -12.62   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.515 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1879, Adjusted R-squared:  0.1867 
## F-statistic: 159.1 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -24.6658  -3.9100  -0.6752   3.4947  25.5210 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     17.7572     0.2377   74.69   <2e-16 ***
## wSCOREMAT.2011 -72.9660     5.7960  -12.59   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.196 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1872, Adjusted R-squared:  0.186 
## F-statistic: 158.5 on 1 and 688 DF,  p-value: < 2.2e-16

4.2.2 UC vs Pampalon | social

4.2.2.1 Bike lane length

Bike lane ratio to streets (in %)

4.2.2.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.126  -8.483  -1.894   5.239  55.220 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.4115     0.4605  18.267   <2e-16 ***
## wSCORESOC.2011  13.9299    11.9135   1.169    0.243    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.464 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.001983,   Adjusted R-squared:  0.0005326 
## F-statistic: 1.367 on 1 and 688 DF,  p-value: 0.2427
4.2.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.6670 -4.9958 -0.7933  3.8783 24.9297 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.2950     0.3282  25.277   <2e-16 ***
## wSCORESOC.2011  18.3043     8.4904   2.156   0.0314 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.745 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.00671,    Adjusted R-squared:  0.005267 
## F-statistic: 4.648 on 1 and 688 DF,  p-value: 0.03144
4.2.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.4083 -4.1527 -0.6607  3.1263 20.5500 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.3114     0.2793  29.761  < 2e-16 ***
## wSCORESOC.2011  20.6704     7.2254   2.861  0.00435 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.74 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.01176,    Adjusted R-squared:  0.01032 
## F-statistic: 8.184 on 1 and 688 DF,  p-value: 0.004354
4.2.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane.by.street.2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane.by.street.2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.4108 -3.7743 -0.6908  2.4571 19.2676 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      8.3853     0.2497  33.575  < 2e-16 ***
## wSCORESOC.2011  19.7214     6.4615   3.052  0.00236 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.133 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.01336,    Adjusted R-squared:  0.01192 
## F-statistic: 9.315 on 1 and 688 DF,  p-value: 0.00236

4.2.2.2 Canopy

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.2.2.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -41.160  -8.631  -0.185   7.616  48.600 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      44.829      0.637   70.37   <2e-16 ***
## wSCORESOC.2011 -308.789     16.482  -18.73   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.09 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3378, Adjusted R-squared:  0.3369 
## F-statistic:   351 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -31.464  -6.484  -0.223   5.905  40.372 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      42.0944     0.5106   82.44   <2e-16 ***
## wSCORESOC.2011 -269.0628    13.2111  -20.37   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.5 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3761, Adjusted R-squared:  0.3752 
## F-statistic: 414.8 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.562  -6.357  -0.285   6.124  37.934 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      41.7528     0.4873   85.68   <2e-16 ***
## wSCORESOC.2011 -250.7765    12.6084  -19.89   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.02 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3651, Adjusted R-squared:  0.3642 
## F-statistic: 395.6 on 1 and 688 DF,  p-value: < 2.2e-16
4.2.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -25.132  -6.646  -0.006   5.852  36.685 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      41.573      0.475   87.52   <2e-16 ***
## wSCORESOC.2011 -239.092     12.290  -19.45   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.764 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.3549, Adjusted R-squared:  0.3539 
## F-statistic: 378.4 on 1 and 688 DF,  p-value: < 2.2e-16

4.2.2.3 Canopy (trees)

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.2.2.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -20.424  -6.539  -1.281   4.979  45.812 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     19.9448     0.4585  43.496  < 2e-16 ***
## wSCORESOC.2011 -68.0181    11.8637  -5.733 1.47e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.425 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0456, Adjusted R-squared:  0.04421 
## F-statistic: 32.87 on 1 and 688 DF,  p-value: 1.475e-08
4.2.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -15.390  -5.380  -1.162   3.970  31.006 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.4134     0.3681  50.025  < 2e-16 ***
## wSCORESOC.2011 -49.0855     9.5232  -5.154 3.33e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.565 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.03718,    Adjusted R-squared:  0.03578 
## F-statistic: 26.57 on 1 and 688 DF,  p-value: 3.331e-07
4.2.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -14.032  -5.059  -1.291   4.093  29.050 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.3659     0.3461  53.070  < 2e-16 ***
## wSCORESOC.2011 -42.5593     8.9537  -4.753 2.44e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.113 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0318, Adjusted R-squared:  0.03039 
## F-statistic: 22.59 on 1 and 688 DF,  p-value: 2.438e-06
4.2.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_high_2011b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_high_2011b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -13.114  -5.005  -1.117   3.803  26.489 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     18.3146     0.3294  55.595  < 2e-16 ***
## wSCORESOC.2011 -38.8036     8.5231  -4.553 6.26e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 6.771 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.02925,    Adjusted R-squared:  0.02784 
## F-statistic: 20.73 on 1 and 688 DF,  p-value: 6.262e-06

4.2.3 UC vs gentrified CT

Gentrified CT between 2011 and 2016

4.2.3.1 Bike lane length

Bike lane ratio to streets (in %)

4.2.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011ct, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      5    4.95   0.056  0.813
## Residuals            688  60902   88.52               
## 15 observations deleted due to missingness
4.2.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b250, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      2    1.67   0.037  0.847
## Residuals            688  31057   45.14               
## 15 observations deleted due to missingness
4.2.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b500, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     22   21.78   0.664  0.416
## Residuals            688  22580   32.82               
## 15 observations deleted due to missingness
4.2.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane.by.street.2011b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane.by.street.2011b750, na.rm = TRUE),
    sd = sd(Bike_lane.by.street.2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane.by.street.2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     41   40.84   1.547  0.214
## Residuals            688  18163   26.40               
## 15 observations deleted due to missingness

4.2.3.2 Canopy

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

4.2.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_2011ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  23284   23284   102.9 <2e-16 ***
## Residuals            688 155714     226                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_2011b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  14776   14776   94.56 <2e-16 ***
## Residuals            688 107511     156                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_2011b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  12682   12682   90.12 <2e-16 ***
## Residuals            688  96815     141                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_2011b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)    
## gentrified_2016_2011   1  11029   11029   82.95 <2e-16 ***
## Residuals            688  91471     133                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

4.2.3.3 Canopy (trees)

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

4.2.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1856  1855.8   20.54 6.89e-06 ***
## Residuals            688  62160    90.3                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.3.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    786   786.4   13.43 0.000266 ***
## Residuals            688  40275    58.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.3.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    632   632.0   12.27 0.000491 ***
## Residuals            688  35449    51.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
4.2.3.3.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_high_2011b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_high_2011b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_high_2011b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_high_2011b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1    476   476.4    10.2 0.00147 **
## Residuals            688  32147    46.7                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5 Association between SES and Urban Interventions at baseline (2011)

Looking at objective #1 | do urban interventions tend to be located in low SES neighborhoods?. We look at \[Urban Intervention_{2011 \to 2016} = f(SES_{2011})\] as well as \[Urban Intervention_{2011 \to 2016} = f(Gentrification_{2011 \to 2016})\]

Here \(Urban Intervention\) means the changes in the urban environment features, such as variation of bike lane length, greenness coverage, etc.

5.1 Whole CMA

5.1.1 UI vs Pampalon | material

5.1.1.1 Bike lane length change

Bike lane ratio to streets (in %)

5.1.1.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016ct ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -103.753   -3.740   -3.698    0.892   96.265 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.7298     0.3677  10.143   <2e-16 ***
## wSCOREMAT.2011  -0.6843     9.0024  -0.076    0.939    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.686 on 701 degrees of freedom
##   (267 observations deleted due to missingness)
## Multiple R-squared:  8.242e-06,  Adjusted R-squared:  -0.001418 
## F-statistic: 0.005777 on 1 and 701 DF,  p-value: 0.9394
5.1.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b250 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -42.131  -3.366  -2.454   1.626  53.114 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.3818     0.2232  15.152   <2e-16 ***
## wSCOREMAT.2011  -5.0689     5.5183  -0.919    0.359    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.961 on 720 degrees of freedom
##   (248 observations deleted due to missingness)
## Multiple R-squared:  0.001171,   Adjusted R-squared:  -0.0002167 
## F-statistic: 0.8438 on 1 and 720 DF,  p-value: 0.3586
5.1.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b500 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.433  -3.254  -1.833   2.045  18.674 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.3600     0.1796  18.711   <2e-16 ***
## wSCOREMAT.2011  -5.4457     4.4463  -1.225    0.221    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.807 on 723 degrees of freedom
##   (245 observations deleted due to missingness)
## Multiple R-squared:  0.00207,    Adjusted R-squared:  0.0006902 
## F-statistic:   1.5 on 1 and 723 DF,  p-value: 0.2211
5.1.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b750 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.257 -3.118 -1.475  1.962 19.103 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.3432     0.1563  21.388   <2e-16 ***
## wSCOREMAT.2011  -4.6639     3.8831  -1.201     0.23    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.205 on 730 degrees of freedom
##   (238 observations deleted due to missingness)
## Multiple R-squared:  0.001972,   Adjusted R-squared:  0.000605 
## F-statistic: 1.443 on 1 and 730 DF,  p-value: 0.2301

5.1.1.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

5.1.1.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017ct ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.387  -2.936  -0.804   1.387  40.976 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.7797     0.1764  27.092   <2e-16 ***
## wSCOREMAT.2011  -6.5201     4.7709  -1.367    0.172    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.406 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.001968,   Adjusted R-squared:  0.0009145 
## F-statistic: 1.868 on 1 and 947 DF,  p-value: 0.1721
5.1.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b250 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.376 -2.658 -0.697  1.157 48.343 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.6272     0.1668  27.738   <2e-16 ***
## wSCOREMAT.2011 -10.4401     4.5112  -2.314   0.0209 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.112 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.005624,   Adjusted R-squared:  0.004574 
## F-statistic: 5.356 on 1 and 947 DF,  p-value: 0.02087
5.1.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b500 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.712 -2.610 -0.636  1.021 42.968 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.5938     0.1619  28.375   <2e-16 ***
## wSCOREMAT.2011  -9.9613     4.3780  -2.275   0.0231 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.961 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.005437,   Adjusted R-squared:  0.004387 
## F-statistic: 5.177 on 1 and 947 DF,  p-value: 0.02311
5.1.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b750 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.363 -2.528 -0.689  0.947 36.236 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.5701     0.1563  29.241   <2e-16 ***
## wSCOREMAT.2011 -10.4889     4.2264  -2.482   0.0132 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.789 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.006462,   Adjusted R-squared:  0.005412 
## F-statistic: 6.159 on 1 and 947 DF,  p-value: 0.01325

5.1.1.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

5.1.1.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017ct ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.9362  -1.4430  -0.2191   1.1718  11.7012 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.97785    0.07524  39.577  < 2e-16 ***
## wSCOREMAT.2011 -11.15190    2.03468  -5.481 5.43e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.306 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.03075,    Adjusted R-squared:  0.02972 
## F-statistic: 30.04 on 1 and 947 DF,  p-value: 5.426e-08
5.1.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b250 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.5822 -1.1723 -0.1726  0.9719  7.2733 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.72401    0.06123  44.489  < 2e-16 ***
## wSCOREMAT.2011 -11.27199    1.65573  -6.808 1.76e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.876 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.04666,    Adjusted R-squared:  0.04565 
## F-statistic: 46.35 on 1 and 947 DF,  p-value: 1.757e-11
5.1.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b500 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.0515 -1.0786 -0.1097  0.8717  7.7815 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.63377    0.05773   45.62  < 2e-16 ***
## wSCOREMAT.2011 -10.11663    1.56114   -6.48 1.47e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.769 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.04246,    Adjusted R-squared:  0.04145 
## F-statistic: 41.99 on 1 and 947 DF,  p-value: 1.47e-10
5.1.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b750 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -19.9917  -1.0242  -0.0716   0.8835   6.7288 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.54472    0.05811  43.792  < 2e-16 ***
## wSCOREMAT.2011 -9.32873    1.57139  -5.937 4.08e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.781 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.03588,    Adjusted R-squared:  0.03486 
## F-statistic: 35.24 on 1 and 947 DF,  p-value: 4.08e-09

5.1.2 UI vs Pampalon | social

5.1.2.1 Bike lane length change

Bike lane ratio to streets (in %)

5.1.2.1.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016ct ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -102.643   -4.287   -2.720    0.842   98.920 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.6785     0.4587   5.840    8e-09 ***
## wSCORESOC.2011  44.3722    11.9360   3.718 0.000217 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.592 on 701 degrees of freedom
##   (267 observations deleted due to missingness)
## Multiple R-squared:  0.01933,    Adjusted R-squared:  0.01793 
## F-statistic: 13.82 on 1 and 701 DF,  p-value: 0.0002172
5.1.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b250 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -40.725  -3.417  -1.584   1.821  53.748 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.1855     0.2696   8.105 2.26e-15 ***
## wSCORESOC.2011  50.6745     7.0585   7.179 1.75e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.761 on 720 degrees of freedom
##   (248 observations deleted due to missingness)
## Multiple R-squared:  0.0668, Adjusted R-squared:  0.06551 
## F-statistic: 51.54 on 1 and 720 DF,  p-value: 1.75e-12
5.1.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b500 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -29.104  -3.049  -1.288   1.932  17.577 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.2512     0.2141   10.52  < 2e-16 ***
## wSCORESOC.2011  47.0979     5.6134    8.39 2.54e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.593 on 723 degrees of freedom
##   (245 observations deleted due to missingness)
## Multiple R-squared:  0.08873,    Adjusted R-squared:  0.08747 
## F-statistic:  70.4 on 1 and 723 DF,  p-value: 2.542e-16
5.1.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df), aes(y=Bike_lane_diff.by.street.2011.2016b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b750 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.773 -2.658 -1.087  1.687 18.710 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.3109     0.1842  12.544   <2e-16 ***
## wSCORESOC.2011  44.3794     4.8466   9.157   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.987 on 730 degrees of freedom
##   (238 observations deleted due to missingness)
## Multiple R-squared:  0.103,  Adjusted R-squared:  0.1018 
## F-statistic: 83.85 on 1 and 730 DF,  p-value: < 2.2e-16

5.1.2.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

5.1.2.2.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017ct ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.335  -2.941  -0.862   1.405  40.640 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.8920     0.2056  23.800   <2e-16 ***
## wSCORESOC.2011  -7.4513     5.8159  -1.281      0.2    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.407 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.00173,    Adjusted R-squared:  0.0006762 
## F-statistic: 1.641 on 1 and 947 DF,  p-value: 0.2004
5.1.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b250 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.130 -2.689 -0.708  1.135 48.051 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.7811     0.1945  24.581   <2e-16 ***
## wSCORESOC.2011 -10.5257     5.5035  -1.913   0.0561 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.116 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.003848,   Adjusted R-squared:  0.002796 
## F-statistic: 3.658 on 1 and 947 DF,  p-value: 0.05611
5.1.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b500 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.852 -2.600 -0.676  1.113 42.612 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.7802     0.1886  25.346   <2e-16 ***
## wSCORESOC.2011 -12.1931     5.3362  -2.285   0.0225 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.961 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.005483,   Adjusted R-squared:  0.004433 
## F-statistic: 5.221 on 1 and 947 DF,  p-value: 0.02253
5.1.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_2011.2017b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b750 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -8.068 -2.500 -0.624  1.066 35.989 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       4.779      0.182  26.257  < 2e-16 ***
## wSCORESOC.2011  -13.514      5.150  -2.624  0.00882 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.787 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.007219,   Adjusted R-squared:  0.006171 
## F-statistic: 6.886 on 1 and 947 DF,  p-value: 0.008825

5.1.2.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

5.1.2.3.1 Census tract level
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017ct ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017ct ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.8633  -1.4521  -0.1813   1.2736   9.7210 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.50495    0.08488  29.512   <2e-16 ***
## wSCORESOC.2011 23.40028    2.40157   9.744   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.233 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.09112,    Adjusted R-squared:  0.09016 
## F-statistic: 94.94 on 1 and 947 DF,  p-value: < 2.2e-16
5.1.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b250 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.2426 -1.0960 -0.1746  0.9301  6.6737 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.26390    0.06825   33.17   <2e-16 ***
## wSCORESOC.2011 22.68057    1.93109   11.74   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.795 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.1271, Adjusted R-squared:  0.1262 
## F-statistic: 137.9 on 1 and 947 DF,  p-value: < 2.2e-16
5.1.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b500 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.5668 -0.9478 -0.1608  0.8437  7.4360 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.18811    0.06385   34.27   <2e-16 ***
## wSCORESOC.2011 22.13357    1.80670   12.25   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.68 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.1368, Adjusted R-squared:  0.1359 
## F-statistic: 150.1 on 1 and 947 DF,  p-value: < 2.2e-16
5.1.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df), aes(y=pct_esp_vert_diff_high_2011.2017b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b750 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -19.6443  -0.8833  -0.1231   0.7796   6.3787 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.11303    0.06435   32.84   <2e-16 ***
## wSCORESOC.2011 21.53741    1.82080   11.83   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.693 on 947 degrees of freedom
##   (21 observations deleted due to missingness)
## Multiple R-squared:  0.1287, Adjusted R-squared:  0.1278 
## F-statistic: 139.9 on 1 and 947 DF,  p-value: < 2.2e-16

5.1.3 UI vs gentrified CT

Gentrified CT between 2011 and 2016

5.1.3.1 Bike lane length change

Bike lane ratio to streets (in %)

5.1.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016ct, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 244 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1    784   784.4   8.461 0.00374 **
## Residuals            701  64986    92.7                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 267 observations deleted due to missingness
5.1.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016b250, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 225 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1172    1172   34.53 6.43e-09 ***
## Residuals            720  24449      34                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 248 observations deleted due to missingness
5.1.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016b500, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 222 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1045  1045.2   48.14 8.83e-12 ***
## Residuals            723  15697    21.7                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 245 observations deleted due to missingness
5.1.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016b750, x=gentrified_2016_2011)) +
  geom_boxplot()
## Warning: Removed 215 rows containing non-finite values (stat_boxplot).

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    844   844.0   50.98 2.26e-12 ***
## Residuals            730  12086    16.6                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 238 observations deleted due to missingness

5.1.3.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

5.1.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      0   0.033   0.001  0.973
## Residuals            945  27144  28.724               
## 23 observations deleted due to missingness
5.1.3.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      6    5.94   0.232   0.63
## Residuals            945  24218   25.63               
## 23 observations deleted due to missingness
5.1.3.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1      6   5.686   0.236  0.627
## Residuals            945  22742  24.066               
## 23 observations deleted due to missingness
5.1.3.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)
## gentrified_2016_2011   1     11   10.83   0.484  0.487
## Residuals            945  21143   22.37               
## 23 observations deleted due to missingness

5.1.3.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

5.1.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017ct ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    234   234.1   45.86 2.23e-11 ***
## Residuals            945   4824     5.1                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.3.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    191  190.88    55.7 1.91e-13 ***
## Residuals            945   3238    3.43                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.3.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1  182.4  182.40   60.16 2.26e-14 ***
## Residuals            945 2865.3    3.03                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
5.1.3.3.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    188  188.01   61.36 1.27e-14 ***
## Residuals            945   2895    3.06                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness

5.2 INTERACT study area

# keep only interact CT
bei_df_aoi <- filter(bei_df, interact_aoi)

5.2.1 UI vs Pampalon | material

5.2.1.1 Bike lane length change

Bike lane ratio to streets (in %)

5.2.1.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016ct ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -10.442  -3.695  -3.621   0.992  38.452 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.6795     0.2761  13.328   <2e-16 ***
## wSCOREMAT.2011  -1.2310     6.7303  -0.183    0.855    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.194 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  4.862e-05,  Adjusted R-squared:  -0.001405 
## F-statistic: 0.03345 on 1 and 688 DF,  p-value: 0.8549
5.2.1.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b250 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.425  -3.455  -2.437   1.626  27.938 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4854     0.2095  16.637   <2e-16 ***
## wSCOREMAT.2011  -5.3511     5.1073  -1.048    0.295    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.459 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.001593,   Adjusted R-squared:  0.0001418 
## F-statistic: 1.098 on 1 and 688 DF,  p-value: 0.2951
5.2.1.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b500 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.367 -3.310 -1.827  2.005 18.540 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4779     0.1803   19.29   <2e-16 ***
## wSCOREMAT.2011  -6.4606     4.3960   -1.47    0.142    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.699 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.00313,    Adjusted R-squared:  0.001681 
## F-statistic:  2.16 on 1 and 688 DF,  p-value: 0.1421
5.2.1.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b750 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.565 -3.039 -1.415  1.939 18.956 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4705     0.1622   21.40   <2e-16 ***
## wSCOREMAT.2011  -5.5739     3.9538   -1.41    0.159    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.226 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.00288,    Adjusted R-squared:  0.001431 
## F-statistic: 1.987 on 1 and 688 DF,  p-value: 0.1591

5.2.1.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

5.2.1.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017ct ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.165  -1.944  -0.273   1.524  37.029 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      4.1619     0.1313  31.687   <2e-16 ***
## wSCOREMAT.2011   1.7219     3.2020   0.538    0.591    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.423 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0004201,  Adjusted R-squared:  -0.001033 
## F-statistic: 0.2892 on 1 and 688 DF,  p-value: 0.5909
5.2.1.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b250 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.827 -1.729 -0.027  1.341 34.699 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.9602     0.1125  35.192   <2e-16 ***
## wSCOREMAT.2011  -1.7145     2.7434  -0.625    0.532    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.932 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0005674,  Adjusted R-squared:  -0.0008853 
## F-statistic: 0.3906 on 1 and 688 DF,  p-value: 0.5322
5.2.1.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b500 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.614 -1.542 -0.055  1.293 32.079 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.8940     0.1049  37.116   <2e-16 ***
## wSCOREMAT.2011  -1.2350     2.5576  -0.483    0.629    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.734 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0003388,  Adjusted R-squared:  -0.001114 
## F-statistic: 0.2332 on 1 and 688 DF,  p-value: 0.6293
5.2.1.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b750 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.6691 -1.5113 -0.0059  1.2007 29.1958 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.8425     0.1008  38.102   <2e-16 ***
## wSCOREMAT.2011  -1.7355     2.4585  -0.706     0.48    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.628 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0007238,  Adjusted R-squared:  -0.0007286 
## F-statistic: 0.4983 on 1 and 688 DF,  p-value: 0.4805

5.2.1.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

5.2.1.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017ct, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017ct ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017ct ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.8508 -1.4234 -0.3206  1.1810 11.3606 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4314     0.0846  40.560  < 2e-16 ***
## wSCOREMAT.2011 -11.9113     2.0625  -5.775 1.16e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.205 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04624,    Adjusted R-squared:  0.04485 
## F-statistic: 33.35 on 1 and 688 DF,  p-value: 1.164e-08
5.2.1.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017b250, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b250 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b250 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9628 -1.1429 -0.2624  0.8870  6.8083 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.15716    0.06809  46.369  < 2e-16 ***
## wSCOREMAT.2011 -12.18518    1.65991  -7.341 6.01e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.774 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07264,    Adjusted R-squared:  0.07129 
## F-statistic: 53.89 on 1 and 688 DF,  p-value: 6.007e-13
5.2.1.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017b500, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b500 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b500 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.0396 -1.0949 -0.2033  0.7381  7.3251 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.07086    0.06356  48.316  < 2e-16 ***
## wSCOREMAT.2011 -10.94933    1.54945  -7.067  3.9e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.656 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.06767,    Adjusted R-squared:  0.06632 
## F-statistic: 49.94 on 1 and 688 DF,  p-value: 3.902e-12
5.2.1.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017b750, x=wSCOREMAT.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b750 ~ wSCOREMAT.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b750 ~ wSCOREMAT.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9569 -0.9961 -0.2127  0.7393  6.2521 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.99802    0.05853  51.218  < 2e-16 ***
## wSCOREMAT.2011 -10.33948    1.42699  -7.246 1.16e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.525 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.0709, Adjusted R-squared:  0.06955 
## F-statistic:  52.5 on 1 and 688 DF,  p-value: 1.158e-12

5.2.2 UI vs Pampalon | social

5.2.2.1 Bike lane length change

Bike lane ratio to streets (in %)

5.2.2.1.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016ct ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.158 -4.279 -2.501  1.056 38.436 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       2.453      0.342   7.172 1.91e-12 ***
## wSCORESOC.2011   50.704      8.848   5.731 1.49e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.029 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04556,    Adjusted R-squared:  0.04418 
## F-statistic: 32.84 on 1 and 688 DF,  p-value: 1.495e-08
5.2.2.1.2 Buffers 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b250 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.460 -3.455 -1.580  1.970 26.930 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.2347     0.2551   8.761  < 2e-16 ***
## wSCORESOC.2011  50.8194     6.5991   7.701 4.71e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.242 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.07936,    Adjusted R-squared:  0.07802 
## F-statistic:  59.3 on 1 and 688 DF,  p-value: 4.713e-14
5.2.2.1.3 Buffers 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b500 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -9.104 -3.165 -1.267  1.969 17.510 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.2947     0.2179  10.531   <2e-16 ***
## wSCORESOC.2011  47.7772     5.6374   8.475   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.478 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.09453,    Adjusted R-squared:  0.09321 
## F-statistic: 71.83 on 1 and 688 DF,  p-value: < 2.2e-16
5.2.2.1.4 Buffers 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=Bike_lane_diff.by.street.2011.2016b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(Bike_lane_diff.by.street.2011.2016b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = Bike_lane_diff.by.street.2011.2016b750 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.920 -2.701 -1.004  1.693 18.639 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.3532     0.1948  12.077   <2e-16 ***
## wSCORESOC.2011  45.2288     5.0410   8.972   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.005 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1047, Adjusted R-squared:  0.1034 
## F-statistic:  80.5 on 1 and 688 DF,  p-value: < 2.2e-16

5.2.2.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

5.2.2.2.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017ct ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -12.932  -1.833  -0.256   1.412  37.455 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.6645     0.1637  22.392  < 2e-16 ***
## wSCORESOC.2011  21.0374     4.2341   4.969 8.52e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.364 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.03464,    Adjusted R-squared:  0.03324 
## F-statistic: 24.69 on 1 and 688 DF,  p-value: 8.519e-07
5.2.2.2.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b250 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.503 -1.532 -0.114  1.199 35.231 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4592     0.1395  24.797  < 2e-16 ***
## wSCORESOC.2011  20.4481     3.6092   5.666 2.15e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.867 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04458,    Adjusted R-squared:  0.04319 
## F-statistic:  32.1 on 1 and 688 DF,  p-value: 2.155e-08
5.2.2.2.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b500 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.130 -1.472 -0.087  1.168 32.560 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4322     0.1301  26.384  < 2e-16 ***
## wSCORESOC.2011  18.9216     3.3656   5.622 2.74e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.674 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04392,    Adjusted R-squared:  0.04253 
## F-statistic: 31.61 on 1 and 688 DF,  p-value: 2.744e-08
5.2.2.2.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_2011.2017b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_2011.2017b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_2011.2017b750 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.9585 -1.3476 -0.0941  1.1366 29.6644 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      3.4086     0.1252  27.218  < 2e-16 ***
## wSCORESOC.2011  17.6560     3.2401   5.449 7.05e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.574 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.04137,    Adjusted R-squared:  0.03998 
## F-statistic: 29.69 on 1 and 688 DF,  p-value: 7.051e-08

5.2.2.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

5.2.2.3.1 Census tract level
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017ct, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017ct ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017ct ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.1757 -1.4643 -0.2555  1.0783  9.4173 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.8024     0.1042  26.896   <2e-16 ***
## wSCORESOC.2011  23.5829     2.6957   8.748   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.142 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1001, Adjusted R-squared:  0.0988 
## F-statistic: 76.53 on 1 and 688 DF,  p-value: < 2.2e-16
5.2.2.3.2 Buffer 250m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017b250, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b250 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b250 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.3475 -1.1469 -0.2551  0.8523  6.3683 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.53577    0.08287   30.60   <2e-16 ***
## wSCORESOC.2011 23.20551    2.14397   10.82   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.703 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1455, Adjusted R-squared:  0.1443 
## F-statistic: 117.2 on 1 and 688 DF,  p-value: < 2.2e-16
5.2.2.3.3 Buffer 500m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017b500, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b500 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b500 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9671 -1.0113 -0.2937  0.7154  7.1446 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.48390    0.07688   32.31   <2e-16 ***
## wSCORESOC.2011 22.03989    1.98900   11.08   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.58 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1514, Adjusted R-squared:  0.1502 
## F-statistic: 122.8 on 1 and 688 DF,  p-value: < 2.2e-16
5.2.2.3.4 Buffer 750m
ggplot(units::drop_units(bei_df_aoi), aes(y=pct_esp_vert_diff_high_2011.2017b750, x=wSCORESOC.2011)) +
  geom_point() +
  geom_smooth(method=lm)

res.lm <- lm(pct_esp_vert_diff_high_2011.2017b750 ~ wSCORESOC.2011, data = units::drop_units(bei_df_aoi))
summary(res.lm)
## 
## Call:
## lm(formula = pct_esp_vert_diff_high_2011.2017b750 ~ wSCORESOC.2011, 
##     data = units::drop_units(bei_df_aoi))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.5433 -0.9509 -0.2520  0.6467  6.0843 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      2.4466     0.0707   34.61   <2e-16 ***
## wSCORESOC.2011  20.6944     1.8291   11.31   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.453 on 688 degrees of freedom
##   (15 observations deleted due to missingness)
## Multiple R-squared:  0.1569, Adjusted R-squared:  0.1556 
## F-statistic:   128 on 1 and 688 DF,  p-value: < 2.2e-16

5.2.3 UI vs gentrified CT

Gentrified CT between 2011 and 2016

5.2.3.1 Bike lane length change

Bike lane ratio to streets (in %)

5.2.3.1.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    843   843.4   16.69 4.92e-05 ***
## Residuals            688  34767    50.5                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.1.2 Buffers 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   1124  1123.9    39.8 5.03e-10 ***
## Residuals            688  19426    28.2                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.1.3 Buffers 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    965   965.1    46.5 2.01e-11 ***
## Residuals            688  14280    20.8                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.1.4 Buffers 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=Bike_lane_diff.by.street.2011.2016b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE),
    sd = sd(Bike_lane_diff.by.street.2011.2016b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(Bike_lane_diff.by.street.2011.2016b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1    759   758.6   45.14 3.85e-11 ***
## Residuals            688  11563    16.8                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5.2.3.2 Canopy change

Measuring canopy (i.e. greenness ~ grass & trees) ratio within CT/buffer in 2011 (in %)

5.2.3.2.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1     97   96.85   8.355 0.00397 **
## Residuals            688   7975   11.59                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.2.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)  
## gentrified_2016_2011   1     57   56.50   6.639 0.0102 *
## Residuals            688   5855    8.51                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.2.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value Pr(>F)   
## gentrified_2016_2011   1     59   58.84   7.967 0.0049 **
## Residuals            688   5081    7.39                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.2.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_2011.2017b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_2011.2017b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)   
## gentrified_2016_2011   1     53   53.32   7.808 0.00535 **
## Residuals            688   4699    6.83                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

5.2.3.3 Canopy (trees) change

Measuring high canopy (i.e. trees only) ratio within CT/buffer in 2011 (in %)

5.2.3.3.1 Census tract level
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017ct, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017ct, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017ct, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017ct ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value  Pr(>F)    
## gentrified_2016_2011   1    106  106.33   21.42 4.4e-06 ***
## Residuals            688   3415    4.96                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.3.2 Buffer 250m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017b250, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017b250, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017b250, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017b250 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   78.7   78.70   24.05 1.17e-06 ***
## Residuals            688 2251.4    3.27                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.3.3 Buffer 500m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017b500, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017b500, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017b500, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017b500 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   70.9   70.89   25.03 7.18e-07 ***
## Residuals            688 1948.5    2.83                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness
5.2.3.3.4 Buffer 750m
ggplot(drop_na(units::drop_units(bei_df_aoi), gentrified_2016_2011), aes(y=pct_esp_vert_diff_high_2011.2017b750, x=gentrified_2016_2011)) +
  geom_boxplot()

bei_df_aoi %>% 
  units::drop_units() %>%
  drop_na() %>%
  group_by(gentrified_2016_2011) %>%
  summarise(
    count = n(),
    mean = mean(pct_esp_vert_diff_high_2011.2017b750, na.rm = TRUE),
    sd = sd(pct_esp_vert_diff_high_2011.2017b750, na.rm = TRUE)
  )
# Compute the analysis of variance
res.aov <- aov(pct_esp_vert_diff_high_2011.2017b750 ~ gentrified_2016_2011, data = units::drop_units(bei_df_aoi))
# Summary of the analysis
summary(res.aov)
##                       Df Sum Sq Mean Sq F value   Pr(>F)    
## gentrified_2016_2011   1   68.7   68.74   28.66 1.17e-07 ***
## Residuals            688 1649.8    2.40                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 15 observations deleted due to missingness

6 Summary of association between SES and Built Environment

Below we summarize the trends linking SES and BE (looking at association at the 500m buffer scale and INTERACT study area).

SES metric BE metric UC 2011 trend UI 2011 -> 2016 trend
Pampalon / MAT 2011 Bike lane - .
Pampalon / MAT 2011 Greenness - .
Pampalon / MAT 2011 Tree canopy - -
Pampalon / SOC 2011 Bike lane + +
Pampalon / SOC 2011 Greenness - +
Pampalon / SOC 2011 Tree canopy - +
Gentrified 2011-2016 Bike lane . +
Gentrified 2011-2016 Greenness - +
Gentrified 2011-2016 Tree canopy - +

.: no significant association
-: negative association (higher SES metric => lower BE metric)
+: positive association (higher SES metric => higher BE metric)

7 Exploratory stuff

7.1 Urban conditions and SES

Tackling part 2 of objective #1: a multilevel model to test the reduction in socio-economic inequalities in urban conditions \[𝔼(UC_{ij} \mid X_{ij}) = \beta_{0j} + \beta_{1j} ∗ SES + \beta_{2j} ∗ Time + \beta_{3j} ∗ SES ∗ Time + \epsilon_{ij}\]

Data for bike lanes is available for 2006, 2011 and 2016 whereas greenness (and trees) is only available for 2011 and 2016.

# Reformat data to be in long format. One wants data with the following columns:
# Bike_Length_by_street | Canopy | Canopy_tree | census_year | ScoreMat | ScoreSoc | Gentrified

# Get SCOREMAT
.bei_df_mlm.1 <- bei_df %>%
  select(CT_UID, starts_with("wSCOREMAT")) %>%
  pivot_longer(cols = starts_with("wSCOREMAT"), 
               names_to = "Year", names_prefix = "wSCOREMAT.", 
               values_to = "wSCOREMAT", values_drop_na = TRUE)
# Get SCORESOC
.bei_df_mlm.2 <- bei_df %>%
  select(CT_UID, starts_with("wSCORESOC")) %>%
  pivot_longer(cols = starts_with("wSCORESOC"), 
               names_to = "Year", names_prefix = "wSCORESOC.", 
               values_to = "wSCORESOC", values_drop_na = TRUE)
# Get gentrified flag
.bei_df_mlm.3 <- bei_df %>%
  select(CT_UID, starts_with("gentrified_")) %>%
  pivot_longer(cols = starts_with("gentrified_"), 
               names_to = "Year_span", names_prefix = "gentrified_", 
               values_to = "gentrified", values_drop_na = TRUE) %>%
  extract(Year_span, "Year", "(\\d{4})_*")
# Get bike_lane
.bei_df_mlm.4 <- bei_df %>%
  select(CT_UID, starts_with("Bike_lane.by.street")) %>%
  pivot_longer(cols = starts_with("Bike_lane.by.street"), 
               names_to = "Var", names_prefix = "Bike_lane.by.street.",
               values_to = "bike_lane.by.street", values_drop_na = TRUE) %>%
  extract("Var", c("Year", "Spatial.scale"), "(\\d{4})([[:alnum:]]+)")
# Get Canopy
.bei_df_mlm.5 <- bei_df %>%
  select(CT_UID, starts_with("pct_esp_vert_20")) %>%
  pivot_longer(cols = starts_with("pct_esp_vert_"), 
               names_to = "Var", names_prefix = "pct_esp_vert_",
               values_to = "pct_esp_vert", values_drop_na = TRUE) %>%
  extract("Var", c("Year", "Spatial.scale"), "(\\d{4})([[:alnum:]]+)") %>%
  filter(Year %in% c('2011', '2017')) %>%
  mutate(Year = case_when(Year == '2017' ~ '2016',
                          TRUE ~ Year))
# Get Canopy
.bei_df_mlm.6 <- bei_df %>%
  select(CT_UID, starts_with("pct_esp_vert_high_20")) %>%
  pivot_longer(cols = starts_with("pct_esp_vert_high"), 
               names_to = "Var", names_prefix = "pct_esp_vert_high_",
               values_to = "pct_esp_vert_high", values_drop_na = TRUE) %>%
  extract("Var", c("Year", "Spatial.scale"), "(\\d{4})([[:alnum:]]+)") %>%
  filter(Year %in% c('2011', '2017')) %>%
  mutate(Year = case_when(Year == '2017' ~ '2016',
                          TRUE ~ Year))

# Combine all subsets
bei_df_mlm <- bei_df %>%
  select(CT_UID, interact_aoi, Population) %>%
  full_join(.bei_df_mlm.1, by=c("CT_UID")) %>%
  full_join(.bei_df_mlm.2, by=c("CT_UID", "Year")) %>%
  full_join(.bei_df_mlm.3, by=c("CT_UID", "Year")) %>%
  full_join(.bei_df_mlm.4, by=c("CT_UID", "Year")) %>%
  full_join(.bei_df_mlm.5, by=c("CT_UID", "Year", "Spatial.scale")) %>%
  full_join(.bei_df_mlm.6, by=c("CT_UID", "Year", "Spatial.scale")) %>%
  units::drop_units() %>%
  mutate(Year = factor(Year, levels = c("2006", "2011", "2016")))

7.1.1 Model 1: SCOREMAT & bike lanes

Here, SES is measured through Pampalon Material Score and urban conditions as the ratio of bike lanes to streets within 500m buffers around CT for the INTERACT study area.

# Define multilevel model | buf 500m / INTERACT study area
mlm_data <- bei_df_mlm %>%
  filter(Spatial.scale == 'b500' & interact_aoi)

res.mlm.1 <- lmer(bike_lane.by.street ~ wSCOREMAT*Year + (1 | CT_UID), data = mlm_data, REML = FALSE)
summary(res.mlm.1)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: bike_lane.by.street ~ wSCOREMAT * Year + (1 | CT_UID)
##    Data: mlm_data
## 
##      AIC      BIC   logLik deviance df.resid 
##  12080.9  12126.0  -6032.4  12064.9     2064 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6910 -0.5689  0.0150  0.4956  3.9721 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  CT_UID   (Intercept) 21.74    4.663   
##  Residual             10.12    3.182   
## Number of obs: 2072, groups:  CT_UID, 693
## 
## Fixed effects:
##                    Estimate Std. Error t value
## (Intercept)          6.1993     0.2146  28.888
## wSCOREMAT          -30.0030     5.0477  -5.944
## Year2011             2.7976     0.1731  16.166
## Year2016             6.0636     0.1713  35.393
## wSCOREMAT:Year2011  -6.6511     4.4273  -1.502
## wSCOREMAT:Year2016 -19.2234     4.4824  -4.289
## 
## Correlation of Fixed Effects:
##                 (Intr) wSCOREMAT Yr2011 Yr2016 wSCOREMAT:Y2011
## wSCOREMAT       -0.001                                        
## Year2011        -0.395 -0.079                                 
## Year2016        -0.399 -0.002     0.496                       
## wSCOREMAT:Y2011  0.002 -0.502    -0.061 -0.004                
## wSCOREMAT:Y2016  0.003 -0.490    -0.001 -0.007  0.537
# Plot interactions
plot_model(res.mlm.1, type = 'int')

7.1.2 Model 2: SCORESOC & bike lanes

Here, SES is measured through Pampalon Social Score and urban conditions as the ratio of bike lanes to streets within 500m buffers around CT for the INTERACT study area.

# Define multilevel model | buf 500m / INTERACT study area
mlm_data <- bei_df_mlm %>%
  filter(Spatial.scale == 'b500' & interact_aoi)

res.mlm.2 <- lmer(bike_lane.by.street ~ wSCORESOC*Year + (1 | CT_UID), data = mlm_data, REML = FALSE)
summary(res.mlm.2)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: bike_lane.by.street ~ wSCORESOC * Year + (1 | CT_UID)
##    Data: mlm_data
## 
##      AIC      BIC   logLik deviance df.resid 
##  12014.5  12059.6  -5999.3  11998.5     2064 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.9806 -0.5449  0.0133  0.4693  3.7777 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  CT_UID   (Intercept) 22.882   4.784   
##  Residual              9.476   3.078   
## Number of obs: 2072, groups:  CT_UID, 693
## 
## Fixed effects:
##                    Estimate Std. Error t value
## (Intercept)          6.3020     0.2683  23.485
## wSCORESOC           -4.6459     6.9223  -0.671
## Year2011             2.1407     0.2139  10.010
## Year2016             4.3888     0.2145  20.465
## wSCORESOC:Year2011  19.8810     5.7763   3.442
## wSCORESOC:Year2016  71.4226     5.9042  12.097
## 
## Correlation of Fixed Effects:
##                 (Intr) wSCORESOC Yr2011 Yr2016 wSCORESOC:Y2011
## wSCORESOC       -0.592                                        
## Year2011        -0.408  0.286                                 
## Year2016        -0.407  0.286     0.506                       
## wSCORESOC:Y2011  0.293 -0.497    -0.631 -0.335                
## wSCORESOC:Y2016  0.275 -0.467    -0.329 -0.634  0.533
# Plot interactions
plot_model(res.mlm.2, type = 'int')

7.1.3 Model 3: SCOREMAT, SCORESOC & bike lanes

Here, SES is measured through Pampalon Material Score and urban conditions as the ratio of bike lanes to streets within 500m buffers around CT for the INTERACT study area.

# Define multilevel model | buf 500m / INTERACT study area
mlm_data <- bei_df_mlm %>%
  filter(Spatial.scale == 'b500' & interact_aoi)

res.mlm.3 <- lmer(bike_lane.by.street ~ wSCOREMAT*Year + wSCORESOC*Year + (1 | CT_UID), data = mlm_data, REML = FALSE)
summary(res.mlm.3)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: bike_lane.by.street ~ wSCOREMAT * Year + wSCORESOC * Year + (1 |  
##     CT_UID)
##    Data: mlm_data
## 
##      AIC      BIC   logLik deviance df.resid 
##  11929.2  11991.2  -5953.6  11907.2     2061 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.9910 -0.5448  0.0204  0.4696  3.8358 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  CT_UID   (Intercept) 21.370   4.623   
##  Residual              9.159   3.026   
## Number of obs: 2072, groups:  CT_UID, 693
## 
## Fixed effects:
##                    Estimate Std. Error t value
## (Intercept)          6.3616     0.2621  24.276
## wSCOREMAT          -20.9145     4.9808  -4.199
## Year2011             2.2898     0.2128  10.762
## Year2016             4.4653     0.2124  21.026
## wSCORESOC           -7.4326     6.8311  -1.088
## wSCOREMAT:Year2011 -10.4722     4.2737  -2.450
## wSCOREMAT:Year2016 -22.7475     4.3175  -5.269
## Year2011:wSCORESOC  20.4991     5.7682   3.554
## Year2016:wSCORESOC  68.8116     5.9084  11.646
## 
## Correlation of Fixed Effects:
##                 (Intr) wSCOREMAT Yr2011 Yr2016 wSCORES wSCOREMAT:Y2011
## wSCOREMAT        0.067                                                
## Year2011        -0.415 -0.151                                         
## Year2016        -0.415 -0.119     0.514                               
## wSCORESOC       -0.598 -0.113     0.297  0.298                        
## wSCOREMAT:Y2011 -0.070 -0.507     0.055  0.075  0.120                 
## wSCOREMAT:Y2016 -0.081 -0.494     0.074  0.070  0.140   0.547         
## Y2011:SCORE      0.305  0.140    -0.632 -0.346 -0.511  -0.161         
## Y2016:SCORE      0.286  0.183    -0.346 -0.641 -0.482  -0.122         
##                 wSCOREMAT:Y2016 Y2011:
## wSCOREMAT                             
## Year2011                              
## Year2016                              
## wSCORESOC                             
## wSCOREMAT:Y2011                       
## wSCOREMAT:Y2016                       
## Y2011:SCORE     -0.121                
## Y2016:SCORE     -0.119           0.545
# Plot interactions
plot_model(res.mlm.3, type = 'pred', terms = c('wSCOREMAT', 'wSCORESOC', 'Year'))

7.1.4 Model 4: SCOREMAT, SCORESOC & esp_vert

Here, SES is measured through Pampalon Material Score and urban conditions as the % of greenness within 500m buffers around CT for the INTERACT study area.

# Define multilevel model | buf 500m / INTERACT study area
mlm_data <- bei_df_mlm %>%
  filter(Spatial.scale == 'b500' & interact_aoi)

res.mlm.4 <- lmer(pct_esp_vert ~ wSCOREMAT*Year + wSCORESOC*Year + (1 | CT_UID), data = mlm_data)
summary(res.mlm.4)
## Linear mixed model fit by REML ['lmerMod']
## Formula: pct_esp_vert ~ wSCOREMAT * Year + wSCORESOC * Year + (1 | CT_UID)
##    Data: mlm_data
## 
## REML criterion at convergence: 8586.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.0291 -0.3696 -0.0115  0.3546  8.3748 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  CT_UID   (Intercept) 106.723  10.33   
##  Residual               4.079   2.02   
## Number of obs: 1381, groups:  CT_UID, 692
## 
## Fixed effects:
##                     Estimate Std. Error t value
## (Intercept)          38.6784     0.4572  84.600
## wSCOREMAT           -52.3632     6.4891  -8.069
## Year2016              3.2750     0.1409  23.247
## wSCORESOC          -113.9102     8.8962 -12.804
## wSCOREMAT:Year2016   -6.6956     2.7546  -2.431
## Year2016:wSCORESOC   12.2082     3.7936   3.218
## 
## Correlation of Fixed Effects:
##             (Intr) wSCOREMAT Yr2016 wSCORES wSCOREMAT:
## wSCOREMAT   -0.121                                    
## Year2016    -0.160  0.118                             
## wSCORESOC   -0.478  0.106     0.129                   
## wSCOREMAT:Y -0.028 -0.156    -0.018  0.085            
## Y2016:SCORE  0.031  0.169    -0.594 -0.095  -0.031
# Plot interactions
plot_model(res.mlm.4, type = 'pred', terms = c('wSCOREMAT', 'wSCORESOC', 'Year'))

7.1.5 Model 5: SCOREMAT, SCORESOC & esp_vert_high

Here, SES is measured through Pampalon Material Score and urban conditions as the % of trees within 500m buffers around CT for the INTERACT study area.

# Define multilevel model | buf 500m / INTERACT study area
mlm_data <- bei_df_mlm %>%
  filter(Spatial.scale == 'b500' & interact_aoi)

res.mlm.5 <- lmer(pct_esp_vert_high ~ wSCOREMAT*Year + wSCORESOC*Year + (1 | CT_UID), data = mlm_data)
summary(res.mlm.5)
## Linear mixed model fit by REML ['lmerMod']
## Formula: pct_esp_vert_high ~ wSCOREMAT * Year + wSCORESOC * Year + (1 |  
##     CT_UID)
##    Data: mlm_data
## 
## REML criterion at convergence: 7116.3
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.79327 -0.42696 -0.01133  0.41771  2.90974 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  CT_UID   (Intercept) 46.490   6.818   
##  Residual              1.109   1.053   
## Number of obs: 1381, groups:  CT_UID, 692
## 
## Fixed effects:
##                     Estimate Std. Error t value
## (Intercept)         18.34222    0.29119  62.990
## wSCOREMAT          -30.89844    3.67871  -8.399
## Year2016             2.39289    0.07354  32.540
## wSCORESOC          -36.08253    5.06331  -7.126
## wSCOREMAT:Year2016 -14.76085    1.43738 -10.269
## Year2016:wSCORESOC  19.68596    1.98559   9.914
## 
## Correlation of Fixed Effects:
##             (Intr) wSCOREMAT Yr2016 wSCORES wSCOREMAT:
## wSCOREMAT   -0.124                                    
## Year2016    -0.134  0.128                             
## wSCORESOC   -0.430  0.143     0.123                   
## wSCOREMAT:Y -0.030 -0.131    -0.017  0.092            
## Y2016:SCORE  0.013  0.186    -0.587 -0.061  -0.027
# Plot interactions
plot_model(res.mlm.5, type = 'pred', terms = c('wSCOREMAT', 'wSCORESOC', 'Year'))

7.1.6 Model 6: SCOREMAT, SCORESOC & bike lanes

Here, SES is measured through Pampalon Material Score and urban conditions as the ratio of bike lanes to streets within 500m buffers around CT for the INTERACT study area. Modeled as random slope, not just random intercept.

# Define multilevel model | buf 500m / INTERACT study area
mlm_data <- bei_df_mlm %>%
  filter(Spatial.scale == 'b500' & interact_aoi)

res.mlm.6 <- lmer(bike_lane.by.street ~ wSCOREMAT*Year + (wSCOREMAT | CT_UID), data = mlm_data, REML = FALSE)
summary(res.mlm.6)
## Linear mixed model fit by maximum likelihood  ['lmerMod']
## Formula: bike_lane.by.street ~ wSCOREMAT * Year + (wSCOREMAT | CT_UID)
##    Data: mlm_data
## 
##      AIC      BIC   logLik deviance df.resid 
##  12066.4  12122.8  -6023.2  12046.4     2062 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7067 -0.5578  0.0169  0.4939  4.0111 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  CT_UID   (Intercept)   19.591  4.426        
##           wSCOREMAT   1661.597 40.763   -0.29
##  Residual                9.892  3.145        
## Number of obs: 2072, groups:  CT_UID, 693
## 
## Fixed effects:
##                    Estimate Std. Error t value
## (Intercept)          6.2770     0.2129  29.481
## wSCOREMAT          -33.8973     5.3916  -6.287
## Year2011             2.8204     0.1727  16.328
## Year2016             6.0602     0.1711  35.414
## wSCOREMAT:Year2011  -6.1772     4.4276  -1.395
## wSCOREMAT:Year2016 -18.9365     4.4822  -4.225
## 
## Correlation of Fixed Effects:
##                 (Intr) wSCOREMAT Yr2011 Yr2016 wSCOREMAT:Y2011
## wSCOREMAT       -0.099                                        
## Year2011        -0.387 -0.090                                 
## Year2016        -0.397 -0.014     0.499                       
## wSCOREMAT:Y2011  0.010 -0.469    -0.061 -0.001                
## wSCOREMAT:Y2016  0.002 -0.458     0.000 -0.006  0.540
# Check if model with random slope significantly improves over random intercept
res.mlm.6.null <- lmer(bike_lane.by.street ~ wSCOREMAT*Year + (1 | CT_UID), data = mlm_data, REML = FALSE)
anova(res.mlm.6.null, res.mlm.6)